Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] Renaming tons of files Amar Cosic <amar.cosic@×××××.com>