Explanation of command to uppercase the first letter of a file

Posted by hazielquake on Super User See other posts from Super User or by hazielquake
Published on 2010-06-10T16:49:15Z Indexed on 2010/06/10 16:54 UTC
Read the original article Hit count: 218

Filed under:
|

Hi I'm trying to learn to rename files with the command line, and after browsing around a lot of pages I finally found a command that uppercases the first letter of a file, but the problem is that I want to understand the meaning of each command. The command is:

for i in *; do new=echo "$i" | sed -e 's/^./\U&/'; mv "$i" "$new";done

I understand the 'for' kinda... but not the 'echo' or '`' and especially the sed command. if someone has a little patience to explain the meaning of each thing that'd be awesome! Thanks!

© Super User or respective owner

Related posts about linux

Related posts about command-line