- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Convert upper case file names to lower case
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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-13-2003 07:35 AM
08-13-2003 07:35 AM
mv FILE `echo FILE | tr "[:upper:]" "[:lower:]"`
I know I can use tr to do the renaming, but what would be a good way to find the files.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2003 07:40 AM
08-13-2003 07:40 AM
Re: Convert upper case file names to lower case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2003 07:44 AM
08-13-2003 07:44 AM
SolutionTry this:
# cd
# find . -xdev -type f -name "[[:upper:]]*"
This will list all files (not directories, since the 'find' specified only '-type f' that contain any uppercase characters in their names. You can do what you wish with the output.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2003 07:44 AM
08-13-2003 07:44 AM
Re: Convert upper case file names to lower case
If you want to find the files that are in a directory that that has lower case files mixed up with uppercase files this will work.
ls [A-Z]*
richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2003 07:48 AM
08-13-2003 07:48 AM
Re: Convert upper case file names to lower case
typeset -l file
find . -type f |
while read File
do
file=$File
if [[ "$File" = "$file" ]] ;then
/usr/bin/true
else
mv $File $file
fi
done
of course this is only going to work if all
your directories are lowercase already
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2003 07:50 AM
08-13-2003 07:50 AM
Re: Convert upper case file names to lower case
Just to be cautious I'd script this, and include a check to see if there's already a lower case version - otherwise it'll get overwritten.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2003 07:52 AM
08-13-2003 07:52 AM
Re: Convert upper case file names to lower case
find . -name "[:upper:]" -type "f" -print
Should work, but I am getting mixed results on my 11.11 system. Ideally, you ought to be able to run this:
FILELIST=`find . -name "[:upper:]" -type "f" -print`
for FILENAME in `echo "$FILELIST"`; do
mv "$FILENAME" `echo "$FILENAME"|tr "[:upper:] "[:lower:]"`
and is should work. If it picks up a file that really is all lower case, it won't matter. Your bigger concern is ensuring it got all the upper case ones.
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2003 07:58 AM
08-13-2003 07:58 AM
Re: Convert upper case file names to lower case
Sorry for missing that.
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2003 08:02 AM
08-13-2003 08:02 AM
Re: Convert upper case file names to lower case
typeset -l file
find . -xdev -type f -name "[:upper:]*" |
while read FILE
do
file="$FILE"
mv "$FILE" "$file"
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2003 08:07 AM
08-13-2003 08:07 AM
Re: Convert upper case file names to lower case
find . -name "[[:upper:]]*" -print > list.txt