In principle the command line would be a mighty tool to rename files,
but I just don’t seem to know the right commands,
and google searches in that respect don’t seem to be very elucidating.
The problem:
I have to rename about 500 files.
The file names have upper case letters, and I would like to change them
to lowercase letters.
So I thought that commands like
mv CMBSY*.* cmbsy*.*
would be a good idea, but then I get
mv: given destination „cmbsy*.*“ is not a directory
(translated).
On the other hand, using
rename CMBSY*.* cmbsy*.*
there aren’t any complaints, but just as well, NOTHING happens.
Even DOS had the command `ren’ that would have made it,
but with bash / Linux ?
> For example, given a directory with files:
>
> text1.txt
> text2.txt
> text3.txt
> text4.txt
>
> If you want to rename them so the files are:
>
> file1.txt
> file2.txt
> file3.txt
> file4.txt
>
> the command is:
>
> rename text file text*.txt
>
Thanks, Jim. For all the time I’ve been using Linux, I never realized that
the proper command format was more of a simple text string replacement op
than a fullname-to-fullname operation!
If doing it on CLI isn’t mandatory, just to get the job done you may try krename from OSS repo (supposed you use KDE).
It has many functions and one of them is to just change the name into lower case letters. I have just checked.
rds
kasi
PS:
I know the I-want-to-get-this-working-in-exacly-that-way-!-feeling. Should this apply, just feel free to ignore to above advice.
On Mon, 02 Dec 2013 21:09:51 +0000, Will Honea wrote:
> Thanks, Jim. For all the time I’ve been using Linux, I never realized
> that the proper command format was more of a simple text string
> replacement op than a fullname-to-fullname operation!
That’s what happens when you have a CLI geek helping out.
> Hi Jim!
>
> rename in my case didn’t seem to work,
> see 1st post.
>
> May be that is because I just want to replace uppercase letters in the
> filenames by lowercase letters, whithout changing the file name truely
> itself.
You used wildcards in your example. Don’t do that. As ab said, you need
to use the proper format - your example uses “rename [from] [to]” using
wildcards, and that is incorrect. Wildcards go in the third parameter,
which is actually a filespec. The first two are, as Will says, just
strings denoting the old string value and the new string value to change
it to.
On 2013-12-02 21:06, ratzi wrote:
>
> In principle the command line would be a mighty tool to rename files,
> but I just don’t seem to know how the right commands,
> and google searches in that respect don’t seem to be very elucidating.
I see you got the issue solved, but just in case:
krename - A Powerful Batch Renamer for KDE
gprename - A GTK2 batch renamer for files and directories
And there is another one I can not locate, like multiple move or
multiple rename.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)