June 1, 201313 yr Can anyone tell me how to go about easily removing ALL files on certain shares that do not end in .iso? I would love for a simple method to do this if anyone might be able to assist. Thank You....
June 1, 201313 yr Can anyone tell me how to go about easily removing ALL files on certain shares that do not end in .iso? I would love for a simple method to do this if anyone might be able to assist. Thank You.... The command is easy, but best to do this in three steps to keep from making a mistake. Step 1, type this command (substituting your share name for "Movies") Be careful, since there are both single and double quotes in the command shown here find /mnt/user/Movies -type f ! -iname '*.iso' -exec echo "rm {}" \; >/boot/files_to_remove Step 2. Now, the contents of the file /boot/files_to_remove will be the set of "rm" commands needed. We need to edit it a tiny bit first to deal with any embedded quote marks and special characters. This"sed"command should do it. sed -i -e "s/'/\\\\'/g" -e "s/^rm /rm '/" -e "s/$/'/" /boot/files_to_remove Note: if a file name has a embedded single quote it should now have had a preceding \ added to escape it. It will also quote the entire file name to deal with embedded spaces. To view the contents of the file type: mcedit /boot/files_to_remove hit function key F10 to exit mcedit. (or press ESC followed by 0) The lines will look like this: rm '/mnt/user/Movies/WAR_OF_THE_WORLDS-1953.nfo' Step 3. To invoke the "rm" commands (and actually remove the files), type sh -xv /boot/files_to_remove Edit: fixed file names to all be the same.
June 2, 201313 yr Can anyone tell me how to go about easily removing ALL files on certain shares that do not end in .iso? Not sure if this would help, but....... In Windows Explorer, browse to the share on your server. Typically, everything is sorted by Name (1). If you hit the Type (2) header, it will sort all files by type (in your case, *.iso files). Scroll up/down to find everything that is NOT an ISO file, highlight them all, hit the delete button. Yes to multiple file delete (only if you are sure that you picked the right files).
Archived
This topic is now archived and is closed to further replies.