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, 04: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, 04:49 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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, 04: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 04:56 PM.
 
Old 12-24-2004, 01: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, 01: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 02:46 AM
samba replaces Uppercase char in filenames to lowercase srikz Other *NIX 3 03-03-2006 09:59 AM
replacing all spaces in filenames of a directory merlin23 Linux - Newbie 1 01-11-2005 08:52 AM
samba replaces Uppercase char in filenames to lowercase srikz Red Hat 1 10-26-2004 04:47 AM
using FIND on upper & lowercase filenames linux-singapore Linux - General 2 12-30-2003 12:30 AM


All times are GMT -5. The time now is 03:09 PM.

Main Menu
Advertisement
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