LinuxQuestions.org need a script desperatly...
 Linux - Software This forum is for Software issues. Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

 11-06-2003, 05:05 PM #1 ooagentbender Member   Registered: Sep 2003 Distribution: Vector Linux Posts: 110 Rep: need a script desperatly... Hey I know there are tons of you out there with lotsa unix knowledge so i was hoping you could help me out with a script that will search through a file and all its sub files and find any files contained there in with a " 1 " all by itself in the name just like in the quotes and delete it. thanks a ton!
 11-06-2003, 05:11 PM #2 jim mcnamara Member   Registered: May 2002 Posts: 964 Rep: try - cd to the directory with the files you want to clobber Code: find . -name '* 1 *' -ok rm {} \;
 11-06-2003, 05:13 PM #3 mossy Member   Registered: Aug 2003 Location: USexIRL Distribution: *nix Posts: 849 Rep: kewl - I could not figure out what to do after it found it. Also I thought this will only find filenames and not actually search the file contents???  Also how do you make it a ./ file?? Last edited by mossy; 11-06-2003 at 05:15 PM.
 11-06-2003, 05:41 PM #4 ooagentbender Member   Registered: Sep 2003 Distribution: Vector Linux Posts: 110 Original Poster Rep: ok that works PERFECT! thanks so much. Is there any way to have it automatically delete the files without me having to answer y and hit enter when it finds one? AND does anyone know who you would access a firewire hard drive in the terminal of os x?? Last edited by ooagentbender; 11-06-2003 at 05:45 PM.
 11-06-2003, 05:51 PM #5 bitva Member   Registered: Dec 2002 Location: Los Angeles Distribution: Debian Posts: 72 Rep: try putting a \ before the rm command: \rm not sure about the hard drive question though. sorry.
 11-06-2003, 05:55 PM #6 ooagentbender Member   Registered: Sep 2003 Distribution: Vector Linux Posts: 110 Original Poster Rep: the \ before the rm didn't work but thanks anyway
 11-06-2003, 06:07 PM #7 bitva Member   Registered: Dec 2002 Location: Los Angeles Distribution: Debian Posts: 72 Rep: well, then go all-balls-out and do: find . -name '* 1 *' -ok rm -f {} \;
 11-06-2003, 06:13 PM #8 ooagentbender Member   Registered: Sep 2003 Distribution: Vector Linux Posts: 110 Original Poster Rep: still didn't work....
 11-06-2003, 07:43 PM #9 jim mcnamara Member   Registered: May 2002 Posts: 964 Rep: change the -ok to -exec ok runs exec if you answer yes.

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Cybermagellan Linux - Software 4 03-15-2005 04:22 PM swimfaster Linux - Software 5 08-25-2004 07:26 PM Boffy Linux - Hardware 0 12-13-2003 08:19 AM SpookMonkey Linux - General 9 02-13-2003 05:20 AM bripage Programming 19 08-10-2002 09:06 AM

LinuxQuestions.org

All times are GMT -5. The time now is 08:12 PM.

 Contact Us - Advertising Info - Rules - Privacy - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -