April 7, 20179 yr Hey guys, simple question here. Can someone share the command syntax for searching a directory (and all sub directories) for a specific folder name, and then deleting those folders and all their contents? Context: I want to search /mnt/user/movies for folders named "extrathumbs" and delete both the folder (there will be thousands) and their contents.
April 7, 20179 yr 2 hours ago, itsrumsey said: Hey guys, simple question here. Can someone share the command syntax for searching a directory (and all sub directories) for a specific folder name, and then deleting those folders and all their contents? Context: I want to search /mnt/user/movies for folders named "extrathumbs" and delete both the folder (there will be thousands) and their contents. I cant help you with the commands but I had just done this exact same thing. If your movie folder is shared on your network, mine is , I opened up that folder on my windows machine and used the search for extrathumbs. It took a bit but found all folders and I selected all and deleted. Done Edited April 7, 20179 yr by Harro
April 8, 20179 yr Author That would work except the permissions on the folders say they belong to unix\1000 (the UID Emby docker runs under, I guess) and I can't do it through SMB. I haven't tried logging in to the share as root but that might work.
April 9, 20179 yr Run this to verify what you find before you remove anything: find /mnt/user/movies -type d -name extrathumbs If you're happy removing everything that was found run this: find /mnt/user/movies -type d -name extrathumbs -print0 | xargs -0 rm -r That command will work even if the paths have spaces in their names.
Archived
This topic is now archived and is closed to further replies.