maandag 6 december 2010

neat-handed shell commands

# Search for files containing "text" strings through directories

find . -type f -exec grep -l "text string" {} \;

# Kill more then 1 processes (unix)

ps -ef | grep "process" | awk -F " " '{ print "kill -9 " $2 }'

or

for x in ` ps -ef | grep "process" | awk -F " " '{ print $2 }'`
do
    kill -9 $x
done

Geen opmerkingen:

Een reactie posten