ACPI administration advocacy advocacy advocacy opinion alsa apache apple audio authentication awk bash business cache calendar censorship commandline cron database debian desktop development disk dvd economics emacs email europe exim files firefox firewall flash foss freedom ftp fun git grub hardware hardware html images installation ipod kde kernel keyboard knoppix laptop latex locale lockin longlines mplayer multimedia mysql network nfs openbox openoffice opinion opinion partition pdf perl php politics postgresql printing privacy rant rxvt script scripting scsi security sed server shell siteadmin sitenews sitesoftware skype skype slackware sound spam ssh subversion sudo svk swap t23 t43 terminal text thinkpad thunderbird time timezone ubuntu users versioncontrol video windows wine wordpress wordprocessing xwindows xwindows youtube
The easiest way to convert all the files to lowercase is to use rename. Like this:
rename 'y/A-Z/a-z/' *
Here is a shell script to convert all files in the working directory to lowercase:
#!/bin/bash
for filename in *
do
n=`echo $filename | tr '[:upper:]' '[:lower:]'`
mv $filename $n
done
Here is a perl one-line that does the same thing from the command line:
perl -MFile::Copy -e 'move $_, lc($_) foreach glob "*"'
And a perl script that does the same thing:
#!/usr/bin/perl
use warnings;
use strict;
use File::Copy;
move $_, lc($_) foreach glob '*';
The last perl script is dangerous, as it overwrites files when they acquire the same name due to the conversion.
Posted by Guest User on 2006-04-22 15:31:30.