How to remove invalid characters from multiple filenames in linux using BASH script
Submitted by admin on Mon, 2006-05-22 12:41.
Communications | Debian Support
1) nano remove.sh
2) paste the code into the file
#!/bin/sh
#
#Script to remove : from file names ( it screws up the xbox listing and PC listing )
#For Example: Macguyver:_2x25 would be changed to Macguyver_2x25
#
#remove.sh program to remove colon from file names
cd "/home/video";
for i in *:*;
do
mv "$i" "${i/:/}";
done
3) chmod +x remove.sh
4) NOTE: if NONE of your files have : in them then it will return an error message

Recent comments
51 weeks 6 days ago
1 year 10 weeks ago
1 year 10 weeks ago
1 year 15 weeks ago
1 year 21 weeks ago
1 year 24 weeks ago
1 year 36 weeks ago
1 year 36 weeks ago
1 year 36 weeks ago
1 year 51 weeks ago