ACPI administration advocacy advocacy advocacy opinion alsa apache apple apt aptitude audio authentication awk bash BIOS boot 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 linux locale lockin longlines microsoft minitab 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 statistics subversion sudo svk swap t23 t43 terminal text thinkpad thunderbird time timezone ubuntu upgrade users versioncontrol video windows wine wordpress wordprocessing X40 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 '*';
Red Hat Certified Technician & Engineer (RHCT and RHCE) Training Guide and Administrator's Reference
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.