You are not logged in.
Pages: 1
it is possible quickly renaming many files including subfolders to lowercase?[/b]
Offline
First two matches from Google:
http://webxadmin.free.fr/article/shell- … we-135.php
http://gentoo-wiki.com/TIP_lowercase_fi … irectories
:shock:
So the easiest way is to install convmv:
# pacman -Sy convmv
and run it:
% convmv -r --notest --lower DIRECTORY
Offline
I made some time ago a bash script for this job. It also can remove or substitute space character. This works to directories too as they are special files.
Note: In the script is a sed command that makes _-_ to - conversion.
#!/bin/bash
# Convert filenames to lowercase
# and replace characters
##################################
find . -depth -name '*' | while read file ; do
directory=$(dirname "$file")
oldfilename=$(basename "$file")
newfilename=$(echo "$oldfilename" | tr 'A-Z' 'a-z' | tr ' ' '_' | sed 's/_-_/-/g')
if [ "$oldfilename" != "$newfilename" ]; then
#echo "$directory/$oldfilename" "$directory/$newfilename"
mv -i "$directory/$oldfilename" "$directory/$newfilename"
#echo "$directory"
#echo "$oldfilename"
#echo "$newfilename"
#echo
fi
done
exit 0
Offline
@smoon
thanks!
@Purch
Nice! I never used tr that way, really nice.
Offline
There is also Krename in community
Offline
One word: Thunar
Offline
goooooogle! ;-) (and man rename).
Offline
Pages: 1