Gentoo Archives: gentoo-user

From: Amar Cosic <amar.cosic@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Renaming tons of files
Date: Wed, 27 Feb 2008 15:35:13
Message-Id: 8e6453010802270735y7e0f0d10ub9b4609988bc9ac@mail.gmail.com
In Reply to: Re: [gentoo-user] Renaming tons of files by Daniel Iliev
1 rename command worked (everything is still here :)) ) . Thanks Daniel
2
3
4
5 On Wed, Feb 27, 2008 at 4:30 PM, Daniel Iliev <daniel.iliev@×××××.com>
6 wrote:
7
8 > On Wed, 27 Feb 2008 16:12:41 +0100
9 > "Amar Cosic" <amar.cosic@×××××.com> wrote:
10 >
11 > > Hello
12 > >
13 > > I have issue where I have something.TXT something.PDF and I need to
14 > > rename them to something.txt something.pdf (so with lower cases) . Is
15 > > there any easy way to do this (command,script? )
16 > >
17 > > Thanks
18 > >
19 >
20 >
21 >
22 > Use at your own risk. Make a backup before try.
23 >
24 > 1)
25 > rename ".PDF" ".pdf" *.PDF
26 > rename ".TXT" ".txt" *.TXT
27 >
28 >
29 > 2)
30 > find . -iname "*.pdf" -o -iname "*.txt" | while read -r oldname
31 > do
32 > newname=$(echo "${fname}" | tr [[:upper:]] [[:lower:]])
33 > mv "${oldname}" "${newname}"
34 > done
35 >
36 >
37 >
38 >
39 > --
40 > Best regards,
41 > Daniel
42 > --
43 > gentoo-user@l.g.o mailing list
44 >
45 >
46
47
48 --
49 Amar Ćosić
50 amar.cosic@×××××.com
51 amar@×××××××.ba
52 +38761240095
53 http://www.amar.co.ba