LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   string shell command? (https://www.linuxquestions.org/questions/linux-newbie-8/string-shell-command-219315/)

minm 08-18-2004 01:07 PM

string shell command?
 
What is the bash command to make everything in the directory (in the filenames) lowercase??

Also, is there a website with a bunch of these type of commands?

Thanks

ToniT 08-18-2004 01:17 PM

Not bash spesific, but an easy way to do it:
Code:

rename 'y/A-Z/a-z/' *

minm 08-18-2004 05:35 PM

is there a website where it displays all commands and their indepth help file to it?

minm 08-18-2004 05:37 PM

hmm
i type rename 'y/A-Z/a-z/' *

and it doesn't return anyting, but it doesn't work :(

ToniT 08-18-2004 05:39 PM

http://www.tldp.org/LDP/Bash-Beginne...tml/index.html
and
http://www.tldp.org/LDP/abs/html/index.html

ToniT 08-18-2004 05:44 PM

Works for me, it renames all files to lowercase.

minm 08-18-2004 10:36 PM

hmm, anyone?

ToniT 08-18-2004 10:45 PM

ok, other way to do it:
Code:

for i in *; do mv $i `echo $i | tr A-Z a-z` ; done

minm 08-19-2004 06:23 AM

hmm
i get this error :S

Quote:

mark@linux:~> for i in *; do mv $i `echo $i | tr A-Z a-z` ; done
mv: `abc.avi' and `abc.avi' are the same file
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.

ToniT 08-19-2004 10:07 AM

That is the correct output. Some files are just lowercase already. Rest of the files are now lowercase too.

ToniT 08-19-2004 10:09 AM

and oh.. you seem to have spaces in your files..


All times are GMT -5. The time now is 12:17 PM.