* [gentoo-user] Renaming tons of files
@ 2008-02-27 15:12 Amar Cosic
2008-02-27 15:30 ` Daniel Iliev
2008-02-27 15:40 ` Erik
0 siblings, 2 replies; 13+ messages in thread
From: Amar Cosic @ 2008-02-27 15:12 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 290 bytes --]
Hello
I have issue where I have something.TXT something.PDF and I need to rename
them to something.txt something.pdf (so with lower cases) . Is there any
easy way to do this (command,script? )
Thanks
--
Amar Ćosić
amar.cosic@gmail.com
amar@amar.co.ba
+38761240095
http://www.amar.co.ba
[-- Attachment #2: Type: text/html, Size: 452 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-27 15:12 [gentoo-user] Renaming tons of files Amar Cosic
@ 2008-02-27 15:30 ` Daniel Iliev
2008-02-27 15:35 ` Amar Cosic
2008-02-27 15:40 ` Erik
1 sibling, 1 reply; 13+ messages in thread
From: Daniel Iliev @ 2008-02-27 15:30 UTC (permalink / raw
To: gentoo-user
On Wed, 27 Feb 2008 16:12:41 +0100
"Amar Cosic" <amar.cosic@gmail.com> wrote:
> Hello
>
> I have issue where I have something.TXT something.PDF and I need to
> rename them to something.txt something.pdf (so with lower cases) . Is
> there any easy way to do this (command,script? )
>
> Thanks
>
Use at your own risk. Make a backup before try.
1)
rename ".PDF" ".pdf" *.PDF
rename ".TXT" ".txt" *.TXT
2)
find . -iname "*.pdf" -o -iname "*.txt" | while read -r oldname
do
newname=$(echo "${fname}" | tr [[:upper:]] [[:lower:]])
mv "${oldname}" "${newname}"
done
--
Best regards,
Daniel
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-27 15:30 ` Daniel Iliev
@ 2008-02-27 15:35 ` Amar Cosic
0 siblings, 0 replies; 13+ messages in thread
From: Amar Cosic @ 2008-02-27 15:35 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 959 bytes --]
rename command worked (everything is still here :)) ) . Thanks Daniel
On Wed, Feb 27, 2008 at 4:30 PM, Daniel Iliev <daniel.iliev@gmail.com>
wrote:
> On Wed, 27 Feb 2008 16:12:41 +0100
> "Amar Cosic" <amar.cosic@gmail.com> wrote:
>
> > Hello
> >
> > I have issue where I have something.TXT something.PDF and I need to
> > rename them to something.txt something.pdf (so with lower cases) . Is
> > there any easy way to do this (command,script? )
> >
> > Thanks
> >
>
>
>
> Use at your own risk. Make a backup before try.
>
> 1)
> rename ".PDF" ".pdf" *.PDF
> rename ".TXT" ".txt" *.TXT
>
>
> 2)
> find . -iname "*.pdf" -o -iname "*.txt" | while read -r oldname
> do
> newname=$(echo "${fname}" | tr [[:upper:]] [[:lower:]])
> mv "${oldname}" "${newname}"
> done
>
>
>
>
> --
> Best regards,
> Daniel
> --
> gentoo-user@lists.gentoo.org mailing list
>
>
--
Amar Ćosić
amar.cosic@gmail.com
amar@amar.co.ba
+38761240095
http://www.amar.co.ba
[-- Attachment #2: Type: text/html, Size: 1753 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-27 15:12 [gentoo-user] Renaming tons of files Amar Cosic
2008-02-27 15:30 ` Daniel Iliev
@ 2008-02-27 15:40 ` Erik
2008-02-27 15:50 ` Galevsky
1 sibling, 1 reply; 13+ messages in thread
From: Erik @ 2008-02-27 15:40 UTC (permalink / raw
To: gentoo-user
Amar Cosic skrev:
> I have issue where I have something.TXT something.PDF and I need to rename
> them to something.txt something.pdf (so with lower cases) . Is there any
> easy way to do this (command,script? )
>
emerge kde-misc/krename and see if it is useful to you.
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-27 15:40 ` Erik
@ 2008-02-27 15:50 ` Galevsky
2008-02-27 17:37 ` Alan McKinnon
0 siblings, 1 reply; 13+ messages in thread
From: Galevsky @ 2008-02-27 15:50 UTC (permalink / raw
To: gentoo-user
On Wed, Feb 27, 2008 at 4:40 PM, Erik <esigra@gmail.com> wrote:
> Amar Cosic skrev:
>
> emerge kde-misc/krename and see if it is useful to you.
emerging extra stuff just for a very simple mv or rename ? Oh my God .....
Gal'
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-27 15:50 ` Galevsky
@ 2008-02-27 17:37 ` Alan McKinnon
2008-02-27 18:08 ` Etaoin Shrdlu
2008-02-27 19:04 ` Markus Schönhaber
0 siblings, 2 replies; 13+ messages in thread
From: Alan McKinnon @ 2008-02-27 17:37 UTC (permalink / raw
To: gentoo-user
On Wednesday 27 February 2008, Galevsky wrote:
> On Wed, Feb 27, 2008 at 4:40 PM, Erik <esigra@gmail.com> wrote:
> > Amar Cosic skrev:
> >
> > emerge kde-misc/krename and see if it is useful to you.
>
> emerging extra stuff just for a very simple mv or rename ? Oh my God
> .....
The download is 82kB.
The build is < 30 seconds
I shudder to think of the number of times I've written a script to do
exactly this job, how many times I've seen this exact question on many
mailing lists and the sheer frustration of dealing with all the edge
cases. THIS emerge is infinitely cheaper than other way to do the same
job.
And it's not A rename the OP wants to do - check the thread title
--
Alan McKinnon
alan dot mckinnon at gmail dot com
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-27 18:08 ` Etaoin Shrdlu
@ 2008-02-27 18:00 ` Alan McKinnon
2008-02-27 19:01 ` Uwe Thiem
0 siblings, 1 reply; 13+ messages in thread
From: Alan McKinnon @ 2008-02-27 18:00 UTC (permalink / raw
To: gentoo-user
On Wednesday 27 February 2008, Etaoin Shrdlu wrote:
> On Wednesday 27 February 2008, Alan McKinnon wrote:
> > On Wednesday 27 February 2008, Galevsky wrote:
> > > On Wed, Feb 27, 2008 at 4:40 PM, Erik <esigra@gmail.com> wrote:
> > > > Amar Cosic skrev:
> > > >
> > > > emerge kde-misc/krename and see if it is useful to you.
> > >
> > > emerging extra stuff just for a very simple mv or rename ? Oh my
> > > God .....
> >
> > The download is 82kB.
> > The build is < 30 seconds
>
> Well...if you have kde or most of its libraries already in place.
> Otherwise I think it's not as lightweight :-)
kde ????
/me double checks original mail....
Oops. That was krename. I read rename and tested such.
/me thinks it's time to remember that only livestock are supposed to get
Foot and Mouth disease, not geeks <sheepish grin>
--
Alan McKinnon
alan dot mckinnon at gmail dot com
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-27 17:37 ` Alan McKinnon
@ 2008-02-27 18:08 ` Etaoin Shrdlu
2008-02-27 18:00 ` Alan McKinnon
2008-02-27 19:04 ` Markus Schönhaber
1 sibling, 1 reply; 13+ messages in thread
From: Etaoin Shrdlu @ 2008-02-27 18:08 UTC (permalink / raw
To: gentoo-user
On Wednesday 27 February 2008, Alan McKinnon wrote:
> On Wednesday 27 February 2008, Galevsky wrote:
> > On Wed, Feb 27, 2008 at 4:40 PM, Erik <esigra@gmail.com> wrote:
> > > Amar Cosic skrev:
> > >
> > > emerge kde-misc/krename and see if it is useful to you.
> >
> > emerging extra stuff just for a very simple mv or rename ? Oh my God
> > .....
>
> The download is 82kB.
> The build is < 30 seconds
Well...if you have kde or most of its libraries already in place.
Otherwise I think it's not as lightweight :-)
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-27 18:00 ` Alan McKinnon
@ 2008-02-27 19:01 ` Uwe Thiem
0 siblings, 0 replies; 13+ messages in thread
From: Uwe Thiem @ 2008-02-27 19:01 UTC (permalink / raw
To: gentoo-user
On Wednesday 27 February 2008, Alan McKinnon wrote:
> /me thinks it's time to remember that only livestock are supposed
> to get Foot and Mouth disease, not geeks <sheepish grin>
People (including geeks) can get it as well. It's hard but possible to
get infected. Sieve the spores out of your soil. Then inhale *lots*
of them.
Uwe
--
Informal Linux Group Namibia:
http://www.linux.org.na/
SysEx (Pty) Ltd.:
http://www.SysEx.com.na/
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-27 17:37 ` Alan McKinnon
2008-02-27 18:08 ` Etaoin Shrdlu
@ 2008-02-27 19:04 ` Markus Schönhaber
2008-02-27 19:09 ` [gentoo-user] " Amar Cosic
2008-02-28 16:20 ` [gentoo-user] " Alan McKinnon
1 sibling, 2 replies; 13+ messages in thread
From: Markus Schönhaber @ 2008-02-27 19:04 UTC (permalink / raw
To: gentoo-user
Alan McKinnon wrote:
> And it's not A rename the OP wants to do - check the thread title
The thread title, the OP and the OP's reply to the suggestion to let
rename do the job make me think that a rename is exactly what the OP
wants to do.
Regards
mks
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 13+ messages in thread
* [gentoo-user] Re: Renaming tons of files
2008-02-27 19:04 ` Markus Schönhaber
@ 2008-02-27 19:09 ` Amar Cosic
2008-02-28 16:20 ` [gentoo-user] " Alan McKinnon
1 sibling, 0 replies; 13+ messages in thread
From: Amar Cosic @ 2008-02-27 19:09 UTC (permalink / raw
To: gentoo-user
Yea.. Thanks to all of you for sugestions. Its server without X so
krename is out. Anyway rename did the job. Thanks again
On 2/27/08, Markus Schönhaber <gentoo-user@schoenhaber.de> wrote:
> Alan McKinnon wrote:
>
> > And it's not A rename the OP wants to do - check the thread title
>
> The thread title, the OP and the OP's reply to the suggestion to let
> rename do the job make me think that a rename is exactly what the OP
> wants to do.
>
> Regards
> mks
>
>
> --
> gentoo-user@lists.gentoo.org mailing list
>
>
--
Amar Ćosić
amar.cosic@gmail.com
amar@amar.co.ba
+38761240095
http://www.amar.co.ba
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-27 19:04 ` Markus Schönhaber
2008-02-27 19:09 ` [gentoo-user] " Amar Cosic
@ 2008-02-28 16:20 ` Alan McKinnon
2008-02-29 10:34 ` Markus Schönhaber
1 sibling, 1 reply; 13+ messages in thread
From: Alan McKinnon @ 2008-02-28 16:20 UTC (permalink / raw
To: gentoo-user
On Wednesday 27 February 2008, Markus Schönhaber wrote:
> Alan McKinnon wrote:
> > And it's not A rename the OP wants to do - check the thread title
>
> The thread title, the OP and the OP's reply to the suggestion to let
> rename do the job make me think that a rename is exactly what the OP
> wants to do.
Yes, he does want to rename files - tons of them per the title.
As in, the same behaviour you get from 'ren *.txt *.doc' in Windows and
DOS. This gets exceptionally painful on *nix if you have a few thousand
*.txt files
--
Alan McKinnon
alan dot mckinnon at gmail dot com
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Renaming tons of files
2008-02-28 16:20 ` [gentoo-user] " Alan McKinnon
@ 2008-02-29 10:34 ` Markus Schönhaber
0 siblings, 0 replies; 13+ messages in thread
From: Markus Schönhaber @ 2008-02-29 10:34 UTC (permalink / raw
To: gentoo-user
Alan McKinnon wrote:
>> Alan McKinnon wrote:
>>> And it's not A rename the OP wants to do - check the thread title
> Yes, he does want to rename files - tons of them per the title.
Well...
> As in, the same behaviour you get from 'ren *.txt *.doc' in Windows and
> DOS. This gets exceptionally painful on *nix if you have a few thousand
> *.txt files
What exactly makes doing
rename .txt .doc *.txt
so exceptionally painful?
OK, if the expanded command line exceeds the length limit, one might
have to combine the above with something like xargs. But I feel neither
pain with that nor the need to write a script or install KDE.
Anyway, this gets purely academic since the OP already said that he
could accomplish what he wanted to by using rename.
Regards
mks
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-02-29 10:34 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-27 15:12 [gentoo-user] Renaming tons of files Amar Cosic
2008-02-27 15:30 ` Daniel Iliev
2008-02-27 15:35 ` Amar Cosic
2008-02-27 15:40 ` Erik
2008-02-27 15:50 ` Galevsky
2008-02-27 17:37 ` Alan McKinnon
2008-02-27 18:08 ` Etaoin Shrdlu
2008-02-27 18:00 ` Alan McKinnon
2008-02-27 19:01 ` Uwe Thiem
2008-02-27 19:04 ` Markus Schönhaber
2008-02-27 19:09 ` [gentoo-user] " Amar Cosic
2008-02-28 16:20 ` [gentoo-user] " Alan McKinnon
2008-02-29 10:34 ` Markus Schönhaber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox