find . -type f -name "*.tmp"
. Easy eh? But how to delete them if they span deep into the directory tree? Well, I suppose you can just append the output of your find command into a text file and then have a script do the rm'ing of the files. But, what if you can do all of that work in one command line?So, I mentioned xargs and mentioned what it can do and gave a brief example and lo and behold, he saved a good 5 minutes of extra work. Awesome!
Now, to exemplify what I just said:
find . -type f -name "*.tmp" | xargs rm
Just think of all the possibilities now that you have all of this functionality! You can cp, tar, mv, etc. etc.
Enjoy! Cheers!
No comments:
Post a Comment