Results 1 to 4 of 4
  1. #1

    Exclamation Deleting a file (always the same size) from multiple directories

    Greetings,

    What is the best way to delete a file (always the same size, but different names), that is at different directories?
    I can safely use grep to search for them recursively and delete at the same time?

    Thank you
    Around two decades of web marketing experience & millions of visitors.
    NunoAlex.com explains my expertise & how I can help you.
    Contact me!

  2. #2
    Join Date
    Apr 2007
    Posts
    651
    You can use find and xargs. For instance if you wanted to delete a 100byte file recursively:

    find . -size 100c | xargs rm -f
    Justin Yancey | Northern Virginia & District of Columbia | https://www.linkedin.com/in/justinyancey

  3. #3
    Thank you very much Justin! I'll try it out at a smaller scale.
    Around two decades of web marketing experience & millions of visitors.
    NunoAlex.com explains my expertise & how I can help you.
    Contact me!

  4. #4
    It worked, 2 thumbs up!
    Around two decades of web marketing experience & millions of visitors.
    NunoAlex.com explains my expertise & how I can help you.
    Contact me!

Similar Threads

  1. Copy file to multiple directories via SSH
    By ladless in forum Programming Discussion
    Replies: 18
    Last Post: 08-19-2008, 12:48 PM
  2. 2GB File Hosting w 30GB Bandwidth 100MB File Size
    By danny43 in forum Web Hosting
    Replies: 1
    Last Post: 09-19-2006, 09:38 AM
  3. Deleting file from multiple folders
    By WebHostingNeeds in forum Hosting Security and Technology
    Replies: 4
    Last Post: 07-05-2004, 10:21 AM
  4. Deleting Directories.
    By -Edward- in forum Dedicated Server
    Replies: 3
    Last Post: 12-25-2001, 10:25 PM

Posting Permissions

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