Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: lowercase to UPPERCASE - On command line< Next Oldest | Next Newest >
NewDude Offline





Group: Members
Posts: 150
Joined: Feb. 2006
Posted: April 05 2006,16:11 QUOTE

This is for the total commandline geek...  

Is there a way to change a group of files in a Linux directory from lowercase to uppercase....  

As powerful as the command line is in Unix/Linux, I would think there was.

If not, I guess I need to write a script to do this?

I have PunBB running on my system, the styles are showing up in my browser.  I read on their forum is could a lowercase thing.  They suggested making the php, css files all uppercase.
Back to top
Profile PM 
safesys Offline





Group: Members
Posts: 49
Joined: Mar. 2006
Posted: April 05 2006,17:21 QUOTE

Not sure on a single command, but heres a quick and dirty bash script to do it:

#!/bin/sh
for name in `ls`
do
       mv $name `echo $name | tr 'a-z' 'A-Z'`
done
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: April 05 2006,17:54 QUOTE

safesys, you got it.  You could put what you had on a single command line:

for i in `ls`;do mv $i `echo $i | tr 'a-z' 'A-Z'`;done
Back to top
Profile PM 
NewDude Offline





Group: Members
Posts: 150
Joined: Feb. 2006
Posted: April 05 2006,20:12 QUOTE

Ok...  Thanks to both of you guy for replying..

So I just type for i in `ls`;do mv $i `echo $i | tr 'a-z' 'A-Z'`; in the directory that has the lowercase files?

Isn't there a wildcard and I could use to change every file in that directory...  I think there is 15 files in the root and other files in the other subdirectories...  



O I see   for i (array number is i) in 'ls';   saying every file using the ls command to list the files in the directory..  I know what echo is...   i$ is the array number which points to the value in the array, (variable)..  piped   what is tr...   some type of string maniplication function?  

command line in Linux is powerful.. amazing..   I need to learn this stuff better...
Back to top
Profile PM 
safesys Offline





Group: Members
Posts: 49
Joined: Mar. 2006
Posted: April 05 2006,21:16 QUOTE

don't forget you can use "man command" to get more info on specific commands

eg: man tr

Quote
NAME
      tr - translate or delete characters

SYNOPSIS
      tr [OPTION]... SET1 [SET2]

DESCRIPTION
      Translate,  squeeze,  and/or  delete  characters  from standard input,
      writing to standard output.
Back to top
Profile PM 
8 replies since April 05 2006,16:11 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: lowercase to UPPERCASE - On command line

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code