how to remove long-windows-filename files based on exlusion list
hi guys,
I want search recursively through a directory/subdirectories that contain files of a type i dont want. The unwanted files are listed in my exclusion file /home/knoppix/ex which looks like; *.mp3 [.]mp3 *.avi [.]avi *.mp4 and so on... If i enter ls -r | grep /home/knoppix/ex it spits out matching file/s name in the form; Cool Band - Some Cool Song.zip the rm command doesnt like this naming convention. I think it needs the full path. How can i scipt an automatic removal files based on those in my exclusion file? Thanks |
You should be able to wrap the argument to rm in quotes so that it doesn't complain about the spaces. For example:
Code:
export MYFILE="some file.mp3" |
thanks for the help. i ended up using rsync;
rsync -arz source destination --exclude-from=exclusionfile --delete-excluded I will learn your method too, thanks for the tip :-) |
If you're interested in removing those spaces from Windoze filenames:
Code:
To remove the spaces in files in a directory -> Code:
###To remove spaces from files |
All times are GMT -5. The time now is 02:42 AM. |