Tips tagged awk


1

Tip #262   Kill matching processes without unnecessary greps and extra sh p

ps -eo pid,args | awk '/sleep/ && !/awk/{ system("kill -9 "$1)}' Read more »

0

Tip #259   Ghetto lsof when you don

You might want to get rid of the awk, sort, uniq and grep depending on how much info you need.

Read more »

6

Tip #258   List non-system users

I use the following to list non-system users. It should be portable though won't work on systems without the getent command.

Read more »

0

Tip #249   Sum up your HDD space

Longish oneliner (I actually wrote it in one line first) for giving you somewhat (mount list is never good enough) accurate sum of your file systems' totals.

Read more »

12

Tip #247   See your favorite commands

Use the following to see the commands you use most often based on your shell history:

Read more »

15

Tip #220   Actively Monitor a File

This is a way to monitor "/var/log/messages" or any file for certain changes.
The example below actively monitors "stuff" for the word "now" and as soon as "now" is added to the file, the contents of msg are sent by email

Read more »