LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-20-2004, 03:43 PM   #1
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Rep: Reputation: 30
Making all the filenames in a directory lowercase?


How do i make it so all the files in a directory and sub directory are lowercase?

I want too also make it so it can make files with spaces in them a lowercase..

Is this possible?

Thanks
 
Old 12-20-2004, 03:49 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,988
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Sure is possible, and I've seen similar posts to yours
asked and answered at least twice in the last few days ;)

Have a search!


Cheers,
Tink
 
Old 12-20-2004, 03:53 PM   #3
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
You can use the venerable Sed: http://docs.biostat.wustl.edu/cgi-bi...lower%2520case. Or just use tr, e.g.
Code:
for f in *; do
g=`expr "xxx$f" : 'xxx\(.*\)' | tr '[A-Z]' '[a-z]'`
mv "$f" "$g"
done

Last edited by mjrich; 12-20-2004 at 03:56 PM.
 
Old 12-24-2004, 12:39 AM   #4
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Original Poster
Rep: Reputation: 30
Thanks, where would i put that code in?
 
Old 12-24-2004, 12:50 AM   #5
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
a shell script
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
script to change multiple filenames in a directory jeffreybluml Linux - Newbie 8 12-06-2006 01:46 AM
samba replaces Uppercase char in filenames to lowercase srikz Other *NIX 3 03-03-2006 08:59 AM
replacing all spaces in filenames of a directory merlin23 Linux - Newbie 1 01-11-2005 07:52 AM
samba replaces Uppercase char in filenames to lowercase srikz Red Hat 1 10-26-2004 03:47 AM
using FIND on upper & lowercase filenames linux-singapore Linux - General 2 12-29-2003 11:30 PM


All times are GMT -5. The time now is 02:28 PM.

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