ACPI administration advocacy advocacy advocacy opinion apache apple audio authentication awk bash business cache calendar censorship commandline cron database debian desktop development disk dvd economics emacs email exim files firefox firewall flash foss freedom ftp fun grub hardware hardware html images installation ipod kde kernel knoppix laptop latex lockin longlines mplayer multimedia mysql network nfs openoffice opinion opinion partition pdf perl php politics postgresql printing rant script scripting scsi security sed server shell sitenews skype skype slackware spam ssh subversion sudo svk swap t23 t43 text thinkpad thunderbird time ubuntu users 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.