Mombu the GNU Linux Forum sponsored links

Go Back   Mombu the GNU Linux Forum > GNU_Linux > Mass renaming - JPG to jpg
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 14th September 05:29
mark knecht
External User
 
Posts: 1
Default Mass renaming - JPG to jpg



Hi,
Is there a command line way to rename all files in a directory that
have the extension JPG to the same name but all lower case? (I.e.
FILE.JPG becomes file.jpg or FILE.jpg)

Thanks,
Mark

--
gentoo-user@gentoo.org mailing list
  Reply With Quote


  sponsored links


2 14th September 05:29
patrick marquetecken
External User
 
Posts: 1
Default Mass renaming - JPG to jpg



You could do a find on JPG and replace with jpg

Patrick

Op 25-sep-04 om 18:45 heeft Mark Knecht het volgende geschreven:


--
gentoo-user@gentoo.org mailing list
  Reply With Quote
3 14th September 05:29
alex lambert
External User
 
Posts: 1
Default Mass renaming - JPG to jpg


If you're using bash, then setting up a for loop as:

for a in *.JPG; do mv `basename $a JPG`jpg; done

will do the job. Note the backticks (not apostrophes) around "basename
$a JPG", and the lack of space after it. The backticked command gets
replaced with its output. If you preface the mv command with echo (do
echo mv ...), you'll see a list of the commands that will run (but
they won't BE run - so you can check you got the syntax right). This
will only change the extension, not the rest of the filename.

Alex
x x

--
Website: http://www.penwing.org.uk
Jabber: penwing@jabber.org (go look at http://www.jabber.org)
ICQ: 92075277 (if you must)
Linux User: 360012

--
gentoo-user@gentoo.org mailing list
  Reply With Quote
4 14th September 05:29
tom wesley
External User
 
Posts: 1
Default Mass renaming - JPG to jpg


Or just:
rename .JPG .jpg *.JPG
;-) --
Tom Wesley <tom@tomaw.org>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.9.10 (GNU/Linux)

iD8DBQBBVaaxVYNIRGKYOlIRAun0AJ45vhTQ1mXoSMl1TriRWu 1HpcRpVgCfd8mq
y1VQX8+rtvYfx09UAgVBJZo=
=NpaT
-----END PGP SIGNATURE-----
  Reply With Quote
5 14th September 05:29
ciaran mccreesh
External User
 
Posts: 1
Default Mass renaming - JPG to jpg


On Sat, 25 Sep 2004 09:45:51 -0700 Mark Knecht <markknecht@gmail.com>


| have the extension JPG to the same name but all lower case? (I.e.
| FILE.JPG becomes file.jpg or FILE.jpg)

for a in *.JPG ; do mv "${a}" "${a%.JPG}.jpg" ; done

or

rename .JPG .jpg *.jpg

--
Ciaran McCreesh : Gentoo Developer (Sparc, MIPS, Vim, Fluxbox)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBVaYW96zL6DUtXhERAqUoAJ46gA1KEMZ+kRYHKtuFSz 455rOlNACfdFz/
BIGS5+XTC/zpWtFoH2GcbAA=
=QpVe
-----END PGP SIGNATURE-----
  Reply With Quote
6 14th September 05:30
nick smith
External User
 
Posts: 1
Default Mass renaming - JPG to jpg


im not saying try this but was wondering what would mv *.JPG *.jpg do?

--
gentoo-user@gentoo.org mailing list
  Reply With Quote
7 14th September 05:30
ciaran mccreesh
External User
 
Posts: 1
Default Mass renaming - JPG to jpg


On Sat, 25 Sep 2004 13:47:13 +0000 Nick Smith <nick@computernick.com>

It will either overwrite a load of files or give you an error saying
that the last argument must be a directory.

--
Ciaran McCreesh : Gentoo Developer (Sparc, MIPS, Vim, Fluxbox)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBVbCj96zL6DUtXhERAvUxAKDbVHYxewPmhOiCxBbaoi CH+eZwGgCgwSSr
1mVDIYPtpTPaPqDoTdInXsY=
=l2wA
-----END PGP SIGNATURE-----
  Reply With Quote
8 14th September 05:30
joost van surksum
External User
 
Posts: 1
Default Mass renaming - JPG to jpg


Hello Mark,

Lowering the case of the extension works as follows (piece of shell script):

for i in *.JPG
do
mv $i `basename $i .JPG`.jpg
done

Regards,
Joost

--
gentoo-user@gentoo.org mailing list
  Reply With Quote
9 14th September 05:31
andres moore
External User
 
Posts: 1
Default Mass renaming - JPG to jpg


emerge mmv

mmv: move/copy/append/link multiple files by wildcard patterns.


Andres


--
---

When we are young
Wandering the face of the Earth
Wondering what our dreams might be worth
Learning that we're only immortal
For a limited time

Neil Peart - Dreamline

--
gentoo-user@gentoo.org mailing list
  Reply With Quote
10 14th September 05:31
alexander skwar
External User
 
Posts: 1
Default Mass renaming - JPG to jpg


Yes, there are dozens of command lines. They'll probably all
incorporate a loop and a tool to translate uppercase to lowercase.

Here's my take for bash shell:

for JPG in *.JPG; do
# FILE.JPG -> file.jpg
# mv "$JPG" "$(echo $JPG | tr '[:upper:]' '[:lower:]')"
# FILE.JPG -> FILE.JPG.jpg
# mv "$JPG" "$JPG".jpg
# FILE.JPG -> FILE.jpg
# mv "$JPG" "${JPG%.*}".jpg
done

Alexander Skwar
--
"It ain't so much the things we don't know that get us in trouble. It's the
things we know that ain't so."
-- Artemus Ward aka Charles Farrar Brown
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ


--
gentoo-user@gentoo.org mailing list
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright İ 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666