Results 1 to 7 of 7

Thread: Remove files

  1. #1
    Join Date
    Feb 2004
    Posts
    143

    Unanswered: Remove files

    With the rm command how do I remove all the files I have with the .sav extension from the current folder and all the sub folders that come under the current folder. I would first like to list the files using ls and then remove it using rm.
    What are the flags/options i need to provide with the ls and rm commands

    Thanks

  2. #2
    Join Date
    Oct 2003
    Posts
    19
    files=`find ./ -name '*.sav' 2>/dev/null`
    ls -l $files
    rm -i $files

    Let me know if this helps
    Thanks
    Saurav

  3. #3
    Join Date
    Feb 2004
    Posts
    143
    Thanks Saurav, I will try it right away and let you know

  4. #4
    Join Date
    Feb 2004
    Posts
    143
    Worked wonders !! Perfect and just what I needed. Thanks again

  5. #5
    Join Date
    Oct 2003
    Posts
    19
    Thanks for your gratitude saccskiz :-) ( Sorry for the addressing since don't know your real name ) . Let me know if you need any further help.

    Regards
    Saurav

  6. #6
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    89
    find ./ -name '*.sav' 2>/dev/null|xrgs rm
    Thanks and Regards,

    Praveen Pulikunnu

  7. #7
    Join Date
    Feb 2004
    Posts
    143
    Thanks. I will document this too

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •