A simple stop watch
Answer:
In Linux, you can use a simple command to count the time.
# time read [press Ctrl+D to stop]
real 0m0.967s
user 0m0.000s
sys 0m0.000s
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
A simple stop watch
Answer:
In Linux, you can use a simple command to count the time.
# time read [press Ctrl+D to stop]
real 0m0.967s
user 0m0.000s
sys 0m0.000s
Monitor a directory for file modification
Answer:
You have a directory to monitor, you want to know which files inside is currently changing.
Try the following magic command:
# watch -d -n 2 'df; ls -FlAt;'
When a file is changed, it will be highlighted.
Simple port forwarding using SSH
Answer:
Assume you are working at office, you want to browse the example.com securely, you can do so by using a computer at home (e.g. HOME_IP)to build a secure tunnel using ssh.
# sudo ssh -L 80:example.com:80 HOME_IP
Then in your browser, type http://localhost and you can view the example.com securely.
Determine file type using the file command
Answer:
If you want to determine file type, you can try the file command:
# file /usr/share/perl5/Time/Zone.pm
/usr/share/perl5/Time/Zone.pm: Perl5 module source text
# file /usr/share/vim/vim72/doc/usr_90.txt
/usr/share/vim/vim72/doc/usr_90.txt: ASCII English text
Show the Domain Name Servers for a domain
Answer:
To show the Domain Name Servers for a domain, use the command below:
E.g. example.com
# nslookup -type=ns example.com
Server: 203.98.160.11
Address: 203.98.160.11#53
Non-authoritative answer:
example.com nameserver = b.iana-servers.net.
example.com nameserver = a.iana-servers.net.
Authoritative answers can be found from:
a.iana-servers.net internet address = 192.0.34.43
b.iana-servers.net internet address = 193.0.0.236
b.iana-servers.net has AAAA address 2001:610:240:2::c100:ec