rm and grep
if I wanted to recursively remove Thumbs.db files can I use rm with |grep?
ie rm -rf /mp3|grep Thumbs.db Would this throw an error? or what would happen? |
I believe what that would do is remove the folder /mp3 then try to search for thumbs.db inside the recently deleted folder mp3...Not what you are wanting.
|
You can do it simply like
Code:
rm -rf /mp3/Thumbs.db -i And if u don't want to take any risk with 'rm' command u can attach '-i' at the end of the command. In that case it'll ask u before deleting anything ! |
The pipe operator (|) is used to connect the output of one command to the input of another. In your example, "rm" does not produce any output, so there is nothing to pipe into grep.
|
All times are GMT -5. The time now is 05:37 AM. |