- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: change file name
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 09:19 PM
08-04-2005 09:19 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 09:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 09:38 PM
08-04-2005 09:38 PM
Re: change file name
use this script giving as uniqe argument the directory where you have the file to convert in lowercase:
ls -1 $1|while read a
do
upper=$a
lower=$a
typeset -l lower
mv $1/$upper $1/$lower
done
Regards,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 09:45 PM
08-04-2005 09:45 PM
Re: change file name
cd
for file in `ls`
do
mv $file $(echo $file | tr '[A-Z]' '[a-z]')
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 10:03 PM
08-04-2005 10:03 PM
Re: change file name
Please use following command
2 approaches:
I) If all the files in that dir are to be checked if they are in block letters and if yes convert to small letters then -
goto the directory where these files are and then
for i in `ls -1`
do
echo $i | tr -s '[:upper:]' '[:lower:]' | xargs mv $i
done
This will give u errors for files that are already in small letters - just ignore that.
One important thing here is that if there is already a file with same name in small letters the file will be overwritten.
II>
You can write the filenames which you want to convert into a file - sya files.list and then
for i in `cat files.list`
do
echo $i | tr -s '[:upper:]' '[:lower:]' | xargs mv $i
done
Hpe this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 10:09 PM
08-04-2005 10:09 PM
Re: change file name
# ls -c1 | awk '{ print "mv ",$1,tolower($1); }' | ksh
hth.