« Earlier 3 items total Later »

On this page: 

killing your own dispatch.fcgis

ps aux|grep youruser|grep dispatch|awk '{print $2}'|xargs kill -9

of course you can use this for any process and just change the 'dispatch' part

View processes, grep out by user and then kill all their PIDs

ps axu | grep user | kill -9 `awk ‘{print $2}’`

Clearing out a bunch of spam with spoofed emails that were bounced back to some poor guy with a catchall email

We don't really want to delete them all just in case.

cd /usr/local/scratch/
mkdir junk
find /var/spool/postfix -exec grep "somediscernible-feature.com" '{}' \; | awk '{print($3)}' | xargs -J X mv X ./junk/


The "find" produces

Binary file /var/spool/postfix/active/D/D8832E38 matches
Binary file /var/spool/postfix/active/D/D78EC1C72 matches
Binary file /var/spool/postfix/active/D/D593D279D matches
Binary file /var/spool/postfix/active/D/D0EB32833 matches


The awk

/var/spool/postfix/active/D/D8832E38
/var/spool/postfix/active/D/D78EC1C72
/var/spool/postfix/active/D/D593D279D
/var/spool/postfix/active/D/D0EB32833


And then the mv, moves it.

« Earlier 3 items total Later »