?
Solved

change name to uppercase

Posted on 2005-03-09
3
Medium Priority
?
202 Views
Last Modified: 2010-04-21
Can someone help me to change all filenames in a directory to uppercase? Right now there are various case used (files came off a windows machine). I need to change both the name and the extension to uppercase.

I am using redhat 9 OS.

Thanks in advance.
0
Comment
Question by:James Stone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 13501019
A generic way (you can use bash builtins to be more efficient) is:

for file in /some/dir/*
do
  mv $file `echo $file | tr [a-z] [A-Z]`
done
0
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 13501024
Whoops, should do a:

cd /some/dir

for file in *
do
   mv $file `echo $file | tr [a-z] [A-Z]`
done


The first version would have attempted to uppercase the dirs as well.
0
 

Author Comment

by:James Stone
ID: 13501424
Thank you! Worked great.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month12 days, 1 hour left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question