Category: Command Line

Show Disk Usage – du

du shows the ‘disk usage’ – the space taken up by the files and folders in the current directory. du…

free Command

free gives the Memory info (in kilobytes). free #Output total used free shared buffers cached Mem: 2075000 667508 1407492 0…

last Command

The last command shows a history of logins… last

Double Space a File using Sed

Add a \n after every line in a file using the sed command… sed G

Finger Command

System info about a user. Try: finger root. An admin needs it all the time finger user_name #finger root Login:…

Find Current IP Address

Find the IP address of all the active interfaces. ifconfig | egrep -o ‘^[a-z0-9]{1,12}|inet addr:[0-9.]+’

Basic Diff

If you use the diff command, you will be able to see the difference between the files as shown below:…

whereis command

Find where the command executable is located… whereis perl

Recursive Grep

Recursively check a folder to find the given text using grep grep -R “text” *

Using M4 Command

This command takes an input file and substitutes strings inside it with the parameters passed, similar to substituting for variables….