- Finding the top 20 processing in consuming the RAM.
$ps aux | awk '{print $2, $4, $11}' | sort -k2rn | head -n 20This command will list the top 20 process in decreasing order of their RAM consumption. It will be more helpful if you add a alias this command. Another solution for it is htop.
Install htop. For Fedora/RedHat users.
$yum install htopFor Ubuntu users.
$sudo apt-get install htopFor sorting the processes run htop & type
M for RAM
P for CPU
T for TIME
To invert the processes type I.
- Command chaining.
In order to execute a series of commands regardless of any error, we have to chain them with ';'. For example,
#cd /home/rom/; ls ; cd /home/guest/ ; lsIn order to execute them only if preceding one executed successfully, we will chain them using '&&'.
#cd test && cp -f -R * /home/ron/new && rm -f -R *In order to execute them only if preceding one fails, we will chain them using '||'.
#cd new || mkdir new
- Deleting files using their inode value. Use ls -l to list the inode value.
#find . -inum 123456 -exec rm -i {} \;
References:
http://htop.sourceforge.net/
http://bashshell.net/
http://www.linuxaria.com/
No comments:
Post a Comment