Important: make sure you have a complete backup of your system before running this command, just in case. To do the same thing for a specific directory only, navigate to the directory and then run this command:. Note that these techniques only remove existing. My new favorite utility app is Dot Cleaner. Dot Cleaner says what it does and does what it says. Super simple way to recursively remove all. It is better to see what is removing by adding -print to this answer. There are a lot of these pesky files created by macs:.
This one command addresses all of them. Saves from running find over and over again for multiple matches. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Recursively remove files Ask Question. Asked 12 years ago. Active 2 years, 9 months ago. Viewed k times. Improve this question. Although it's not a duplicate IMO, you should take a look at this: stackoverflow.
Although not what you are asking. I would argue this is a better solution: unix. Add a comment. Active Oldest Votes. Improve this answer. X-Istence X-Istence I know his question didn't ask for it, but I can never remember: does your example handle filenames with spaces?
Yes, that is what the print0 and the -0 to xargs is for. An advice, copy-past the command line… I typed it myself and forgot the -name and now everything got deleted………… my god :X. You wanted to delete the. What were you expecting to happen? What a strange thing. The tip from Adobe Software Inc to use sudo and rm is not the best idea.
Name required. Mail will not be published required. All Rights Reserved. Reproduction without explicit permission is prohibited. Delete All. Enjoy this tip? Subscribe to our newsletter! Thank you! You have successfully joined our subscriber list. Akshay says:. May 1, at pm. Jaydeep says:. April 27, at pm. Genton says:.
April 8, at pm. January 19, at pm. Ellis says:. January 31, at pm. Giles says:. January 9, at pm. Johan says:. August 27, at pm. August 28, at am. JAMES says:. This command can be used for other types of files, as well. Just replace '. You can do this for other file types, as well. For example, you could use find. Note that the asterisk is a wildcard, meaning the Terminal is looking for any file with an extension of.
I am an engineering manager, software engineer, teacher, speaker, and occasional writer.
0コメント