Skip to main content

Posts

Showing posts from August, 2008

Linux Commands - Part 5

du - This used to estimate file space usage. du /home  {shows usage of /home folder and all other files/folders in home folder} du -h /home {show usage in human readable foarmat. Using Mb and Gb} du –maxdepth=0 /home {show enrite /home folder usage only, sumerized one} du –maxdepth=1 /home  {show enrite /home folder and one level down} cut - This used to remove sections in each line. This is most of the time used with pipe command cat /etc/passwd | cut -d":"  -f1 cat /etc/passwd is to show content of the passwd file. We pipe output of that command cut using | (pipe). cut -d":" -f1 {this means split each line of out put by ':' and only display first field (f1)}. Thus if we take only first field we get username. Therefore above command list all the users in our system.  cat /etc/passwd | cut -d":" -f1-3 {show 1,2,3 field ,example :melick:x:1000} cat /etc/passwd | cut -d":"  -f1,3 {show 1 and 3 fields ,example :melick:1000} cat /etc/passwd...