- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- rename files to the same name but with lowercase
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
09-06-2005 02:16 AM
09-06-2005 02:16 AM
f.e:./folder/FILe1.tXT
./folder/fiLE2.TXT
I'm trying with "awk", I'm trying with "tr".
Somebody told me ..."with LINUX anything is imposible"..... I'm not sure :-((
Could you help me, please?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 02:22 AM
09-06-2005 02:22 AM
Re: rename files to the same name but with lowercase
F1="./folder/FILe1.tXT" # or whatever
NEWNAME=$(echo $F1 | tr '[A-Z]' '[a-z]')
mv $F1 $NEWNAME
Regards
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 02:32 AM
09-06-2005 02:32 AM
Re: rename files to the same name but with lowercase
typeset -l newFileName
filename=ABC
newFileName=$filename
print $filename $newFileName
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 02:39 AM
09-06-2005 02:39 AM
Re: rename files to the same name but with lowercase
fileName=ABC
print $fileName | awk '{print tolower($0);}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 02:40 AM
09-06-2005 02:40 AM
Re: rename files to the same name but with lowercase
if [ -f "newfile.txt" ] ;then
... modify name here ...
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 02:45 AM
09-06-2005 02:45 AM
Re: rename files to the same name but with lowercase
I'm not sure about your question, in any case pls try this:
for FILE in `ls -d *`
do
FILE_CAP=`echo $FILE|awk '{ print tolower ($1) }'`
mv FILE FILE_CAP
done
Saludos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 02:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 02:56 AM
09-06-2005 02:56 AM
Re: rename files to the same name but with lowercase
cd /some_folder/
for MYFILE in $(echo * .[!*]}
do
LOWERCASE=$(echo $MYFILE | tr -s '[:upper:]' '[:lower:]')
if [ -a $LOWERCASE ]
then
echo "\nFile $LOWERCASE already exists, cannot rename $MYFILE\n"
else
mv $MYFILE $LOWERCASE
done
Notice the test for a duplicate just in case you have two separate files such as: File1 and FILE1 which will be duplicates when changed to lowercase.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 02:58 AM
09-06-2005 02:58 AM
Re: rename files to the same name but with lowercase
I have some files in a folder.
File1.txT ,FILe2.Txt,fILe3.TXT
I need that all these files become in lowercase, but not one by one; all in the same time.
Like that: file1.txt,file2.txt,file3.txt
Thanks a lot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 03:03 AM
09-06-2005 03:03 AM
Re: rename files to the same name but with lowercase
All of them at once..! uummmhhh, is relative point of view, pls try my last suggestion, this move file by file in an unique cicle.
Saludos.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 03:07 AM
09-06-2005 03:07 AM
Re: rename files to the same name but with lowercase
You could do something like:
# cd /folder
# perl -e 'for $x (@ARGV) {$y=$x;$y=~s/($x)/\L\1/g;rename $x,$y}' FILe1.tXT fiLE2.TXT
This will rename files of mixed upper and lower case as specified by the argument list, to filenames consisting of only lowercase letters.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 03:08 AM
09-06-2005 03:08 AM
Re: rename files to the same name but with lowercase
take this 1-line command that converts your files altogether:
find . -type f|awk '{print $1,tolower($1)}'|xargs -n2 mv 2>/dev/null
Good luck,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 03:09 AM
09-06-2005 03:09 AM
Re: rename files to the same name but with lowercase
Regards,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 03:10 AM
09-06-2005 03:10 AM
Re: rename files to the same name but with lowercase
GREAT !... THANKS A LOT for everybody.
Jose Maria, I didn't see your update. In your third comment I saw the right version.
THANKS & REGARDS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 03:11 AM
09-06-2005 03:11 AM