Thursday, November 14, 2013

Some handy Unix/Linux commands

To find a process with specific string and then kill a series of such processes.
-------------------------------------
kill -9 `ps -ef | grep <string> | grep -v grep | awk '{print $2}'`


Make a file void / empty
------------------------------------
cat /dev/null > abc.txt


Super duper command to remove cache/page cache from Linux
---------------------------------------------------------------------------------------
free && sync && echo 3 > /proc/sys/vm/drop_caches && free

More on this refer...
http://unix.stackexchange.com/questions/87908/how-do-you-empty-the-buffers-and-cache-on-a-linux-system


 

No comments: