March 4, 2009

Using awk for removing files

Posted in Awk at 11:54 am by alessiodini

awk is very powerful!
In this example i used it on a command for deleting some proprietary files:

ls -lrt | awk ‘{ if ($3 ~ /UE019125/) printf “rm -rf %s\n”, $9 }’ | sh

this command deletes all file of UE019125 user

Advertisements

2 Comments »

  1. gigiluillone said,

    ma sei propio scarso

  2. gigiluillone said,

    cosi sbraghi il sistema …


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: