Computing.Net > Forums > Unix > remove files that has particular st

remove files that has particular st

Reply to Message Icon

Original Message
Name: gpatel
Date: July 21, 2005 at 12:35:58 Pacific
Subject: remove files that has particular st
OS: unix
CPU/Ram: 256
Comment:

hello,
i wanted to move those file that has a string like
" I am yello"
so any file that has this string i wanted to move that file somewhere else or remove that file. can someone help w/ easy script.
thanks a lot,
Gpatel


Report Offensive Message For Removal

Response Number 1
Name: Luke Chi
Date: July 22, 2005 at 11:26:06 Pacific
Subject: remove files that has particular st
Reply: (edit)

1. move:

mv `grep -l "I am yello" *` $DESTINATION_DIR

2. remove:

rm `grep -l "I am yello" *`

Luke Chi


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: remove files that has particular st

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software