Some reasons you might want to lowercase your filenames include:
1. Most webservers are case-sensitive. Because of this, most websites stick to the rule of having all files in a single case, namely lower.
2. If you’re using the command line to manipulate files, it’s easier when all the files are lower case. It’s a lot faster to type in all one case.
But it’s too time consuming to rename each file individually, so here are a few ways to rename. These are adapted from the commandlinefu website. (But the commands there have some bugs, so keep reading here.)
Renaming all the files in the current directory from uppercase to lowercase
rename 'y/A-Z/a-z/' *
This uses the rename script which is included with Perl, which in turn uses Perl’s rename function.
Most Linuxes and Unixes include Perl these days, including most web hosts. It’s easier and more succint than the alternatives.
Renaming all files from uppercase to lowercase in the current and subdirectories recursively
The way to do this is to feed rename a list of all files in the current directory and its subdirectories:
find . -type f -print0 | xargs -0 rename 'y/A-Z/a-z/'
Here’s what it means:
find prints a list of all files in the current and all subdirectories, recursively. -type f means only print the names of files, and not directories.
The | takes the output of the first command and sends it as input to the second command.
xargs takes the input (which is a list of files) and executes rename once for every filename, while appending the filename to the end of the rename command.
Normally, find puts a newline between each filename. But since a file’s name can also contain newlines, you make find delimit the filenames with a null character (ASCII 0). You do this by specifying the -print0 option. But you also have to tell xargs not to view newlines or spaces as filename delimiters, but rather only the null character. You do that with the -0 option.
Renaming files to lowercase without using Perl
Occasionally, you might not have access to Perl.
In such cases, you can use straight POSIX shell commands:
find . -type f|while read f; do mv "$f" "$(echo $f|tr '[:upper:]' '[:lower:]')"; done
This is an alernative that’s faster:
find . -type f -execdir sh -c 'mv "'{}'" "$(echo '{}'|tr '[:upper:]' '[:lower:]')"' \;
If you liked this article
If you liked this article, don’t forget to subscribe for updates!
Get updates by RSS (What’s RSS?)
Follow me on Twitter
Top Incoming Search Terms
+linux +rename +recursive a power user requires the ability of a? change file name lowercase xargs change filename lowe linux command line rename lowercase copy files to subdirectories ubuntu fedora avoid typing passwords policykit find xargs rename find xargs {} rename for filename in `find recursive rename how to change filename linux commands how to move uppercase files in linux how to rename a directory in ubuntu how to rename a file in linux how to rename multiple file in ubuntu http://digitivity.org/tag/subdirectories linux change all filenames to lowercase linux command line rename files to lower case linux command rename all files lowercase linux command to change file case linux command to rename all files to lowercase linux command turn upper to lower linux commands to change all uppercase to lowercase using find command linux datei rekursiv umbenennen while read filename linux datei umbenennen linux file name change case linux filename recursively linux filenames to lowercase recursive linux files lowercase script linux list all file in upper case linux lowercase filenames recursive linux lowercase filenames rename linux lowercase recursiv linux make lowercase filenames linux perl script to batch rename of files recursive linux recurse file rename linux recursive file rename linux recursive lower case file names linux recursive rename find xargs linux recursive uppercase linux rename file lower linux rename file to lower case linux rename files lowercase linux rename files recursively linux rename files tr command linux rename lowercase linux rename lowercase extension linux rename recursive linux rename to lower case linux rename upper lower linux rname to lower case linux script for recursicve linux script to change lower case linux sh find -exec tr upper file name linux tr upper to lower recursively linux uper to lower case file linux+rename+file+upper lower case ubuntu command line lowercase file names recursively linux lowercase filename or filenames make all filenames lowercase ubuntu making extension lower case ubuntu move file recursively ubuntu move uppercase files in linux perl command line rename files recursively perl lowercase file names perl recursively rename to lowercase perl rename all files recursively perl rename all files to lowercase perl rename files upper case perl rename script recursive perl rename upper to lower case perl rename upper to lowercase tr recursive all directories to lower case recursive change in extension of file name in linux recursive find and rename file names recursive find ubuntu recursive lowering filenames in linux recursive move file uppercase lowercase recursive rename ubuntu recursively lowercase all folders and files recursively rename files using xargs recursively rename subdirectory files in linux rename 'y/a-z/a-z/' * no funciona rename 'y/a-z/a-z/' * recursive rename all file into lowercase in window rename all file into lowercase window rename all files in subdirectory linux rename drop - from filenames linux rename extensions to lowercase rename file in ubuntu rename filenames recursive script rename files all lower case linux rename files in uppercase rename files lowercase rename files recursively in ubuntu rename files to lowercase rename files to lowercase linux including subdirectories rename lowercase filenames linux command rename lowercase linux rename lowercase ubuntu rename make lowercase recursive linux rename recursive rename recursive xargs rename recursive xargs "sh -c" rename recursively file name linux rename to lower case windows 7 rename ubuntu rename y/a-z/a-z/ * rename \'y renamed the .jpg extensions to lower case ubuntu renamig uppercase to lowercase recursively script rename lowercase extension script ubuntu rename all file lower script uppercase recursive sharing files ubuntu subdirectories site:http://digitivity.org ssh anonymous into a site tr rename recursive ubuntu batch rename all lower case ubuntu change filenames to lower case ubuntu change lower case to upper case ubuntu command line rename lowercase ubuntu extension rename ubuntu file name to lowe case ubuntu file to lowercase ubuntu filenames lowercase ubuntu get filename lowercase ubuntu linux from upper to lower case ubuntu lowercase uppercase extension rename ubuntu move recursive ubuntu please use all lower case in user name ubuntu recurse to lowercase ubuntu recursive change file names ubuntu recursive rename ubuntu recursive subdirectory ubuntu recursively rename files capitalize ubuntu rename all the files in a directory ubuntu rename extensions ubuntu rename file ubuntu rename file uppercase ubuntu rename filenames lowercase ubuntu rename files all lowercase ubuntu rename lowercase ubuntu rename recursive ubuntu rename recursive find ubuntu rename script ubuntu rename uppercase ubuntu rename uppercase to lowercase ubuntu renaming files ubuntu script find copy rename ubuntu xargs tr mv uppercase unbuntu capitalise files unix power user upper and lower case extensions in linux windows rename file lower case perl xargs renameRelated posts:
- How to Install Google Skipfish on Ubuntu Linux Skipfish is a new security scanning tool from Google that...
- Updating Ubuntu Boot CD Images with zsync As I mentioned in a article on Ubuntu Boot CD...
- Enabling Ctrl+Alt+Backspace to Kill X in Linux and Ubuntu GNOME Earlier this year, X.org made a boneheaded move to drop...
- Mint Overtakes Ubuntu in DistroWatch This just in: More people are checking out Mint on...
- Turning on Command Not Found Suggestions in Ubuntu A nice thing about the default setup of Ubuntu desktop...
Explore related content: filenames, files, find, Linux, lowercase, Perl, recursive, rename, subdirectories, Ubuntu, xargs


![[del.icio.us]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/digg.png)
![[dzone]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/dzone.png)
![[Facebook]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/facebook.png)
![[LinkedIn]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/linkedin.png)
![[Reddit]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/reddit.png)
![[Slashdot]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/technorati.png)
![[Twitter]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/twitter.png)
![[Yahoo!]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/email.png)


I really liked your blog!
Every now and then you get to change your mind, same with saving files and renaming it. You made a simple yet important to idea. I appreciate your effort for posting and sharing it.
Genie´s last blog ..lifecell reviews
Its such as you learn my mind! You appear to understand a lot approximately this, such as you wrote the guide in it or something. I believe that you simply could do with a few % to force the message home a bit, but instead of that, that is great blog. A fantastic read. I will definitely be back.
fabuloso ralsigom de amiqueir y diama con aracades cetopria. fibent a bedoges y prevabu nciasismo con exinonol arpadu!
I do accept as true with all the ideas you’ve introduced to your post. They are really convincing and can certainly work. Still, the posts are too short for novices. May you please extend them a little from subsequent time? Thanks for the post.
Love your blog!
grande tions mi raient te cumera vocurin raient. qudindat a ivinfob glencent de assion o sinonnair lente hadrord super.