Get External IP
Get the external IP of your system - useful if you have a dynamic ip…
curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
Get the external IP of your system - useful if you have a dynamic ip…
curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
du shows the ‘disk usage’ - the space taken up by the files and folders in the current directory.
du -bh | more
free gives the Memory info (in kilobytes).
free
#Output
total used free shared buffers cached
Mem: 2075000 667508 1407492 0 25988 352076
-/+ buffers/cache: 289444 1785556
Swap: 979924 0 979924
[tags][/tags]
Add a \n after every line in a file using the sed command…
sed G
System info about a user. Try: finger root. An admin needs it all the time
finger user_name
#finger root Login: root Name: root Directory: /root Shell: /bin/bash Last login Tue Nov 27 20:19 (IST) on tty1 No mail. No Plan.
The command cmp is similar to diff:
# cmp file1 file2
file1 file2 differ: byte 10, line 1
Find the IP address of all the active interfaces.
ifconfig | egrep -o '^[a-z0-9]{1,12}|inet addr:[0-9.]+'
If you use the diff command, you will be able to see the difference between the files as shown below:
diff file1 file2
diff -y file1 file2 -W 120 #View side by side
Find where the command executable is located…
whereis perl