LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-15-2003, 09:21 AM   #1
phz
LQ Newbie
 
Registered: Oct 2003
Location: Norway
Distribution: 98SE, 2000, MS-DOS6.22, Trustix1.5, Slackware 9.1
Posts: 23

Rep: Reputation: 15
How can i change names of multiple files?


Hi - i still trying to figure out how lotta stuff can be done in Linux. My problem is that i d/l (i had booted windoze) all my files from a previous webserver i used, to my windows machine. It turned out that all filenames had changed to uppercase. Is there a simple way (a command, or something) to change file names from upper- to lower case in Linux?
 
Old 11-15-2003, 09:44 AM   #2
Nimoy
Member
 
Registered: Jun 2003
Location: Currently Denmark
Distribution: Ubuntu 11.10
Posts: 334

Rep: Reputation: 30
http://www.kalamazoolinux.org/mailar.../msg00165.html - Has a thread on this particular issue. Even includes a script for your convenience.

Took me 5 seconds or less to find via google by pasting "change file names from upper- to lower case in Linux" into the search box...
 
Old 11-15-2003, 09:50 AM   #3
phz
LQ Newbie
 
Registered: Oct 2003
Location: Norway
Distribution: 98SE, 2000, MS-DOS6.22, Trustix1.5, Slackware 9.1
Posts: 23

Original Poster
Rep: Reputation: 15
Thanx a lot. Seems like it is exactly what i was looking for.

...erm, guess i've become lazy after getting so much good help from this site
 
Old 11-15-2003, 09:57 AM   #4
Nimoy
Member
 
Registered: Jun 2003
Location: Currently Denmark
Distribution: Ubuntu 11.10
Posts: 334

Rep: Reputation: 30
Dr. Tyrell would be most displeased with your performance - What model are you?
 
Old 11-15-2003, 09:59 AM   #5
Nimoy
Member
 
Registered: Jun 2003
Location: Currently Denmark
Distribution: Ubuntu 11.10
Posts: 334

Rep: Reputation: 30
Oh and BTW - Paycheck by PKD is coming out as a movie... if you hadn't heard!
 
Old 11-15-2003, 10:06 AM   #6
TheOther1
Member
 
Registered: Feb 2003
Location: Atlanta, GA
Distribution: RHAS 2.1, RHEL3, RHEL4, SLES 8.3, SLES 9, SLES9_64, SuSE 9.3 Pro, Ubuntu, Gentoo
Posts: 335

Rep: Reputation: 32
Do you have Perl installed? If so, this will work for you:

#!/usr/bin/perl -w
$op = shift or die "Usage: rename expr [files]\n";
chomp(@ARGV = <STDIN>) unless @ARGV;
for (@ARGV) {
$was = $_;
eval $op;
die $@ if $@;
rename($was,$_) unless $was eq $_;
}

Just paste the above lines into a file and save it as rename.pl Move that file into the dir with the files you want to rename and then call it this way:
perl rename.pl 'tr/A-Z/a-z/' *

This will convert all UC files to lc. You should be able to do this also:
perl rename.pl 'tr/A-Z/a-z' *.HTM
if you wanted to convert only .HTM files

HTH!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple names for the same SAMBA server Paul.Hermans Mandriva 0 07-29-2005 09:53 AM
Using grep to change multiple files zwyrbla Linux - General 5 01-11-2005 02:14 PM
Script to change names of files in a directory geomonap Linux - General 2 12-03-2004 03:04 PM
multiple host names tux1982 Linux - Networking 3 06-08-2004 06:35 AM
SAMBA: display of share names is OK but files names are wrong superandrzej Linux - Software 5 02-02-2004 09:14 AM


All times are GMT -5. The time now is 10:27 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration