The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
grep unix.com with google



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-16-2009
Registered User
 

Join Date: Feb 2009
Posts: 3
Smile changing file extension

Hello, everyone! :]

I'm having an issue with my camera/uploading to Photobucket.

When my camera transfers it's photos to my hard drive, it transfers them as .JPG. Unfortunately, when I go to upload to my Photobucket account, it only accepts .jpg & .jpeg files. Every time I want to upload, I have to go through the swath and rename them as .jpg files. This is terribly inconvenient and time consuming, and I was wondering if anyone has heard of a program, or has a terminal command that would change them automatically.

Alternatively, if someone knows how to add .JPG to my list of used picture formats alongside .jpg & .jpeg, that would be just as usefull, if not more usefull.

Note: I run Ubuntu 8.04 and I don't use F-spot, as that program is garbage.

Thanks in advance! - Spidydude
  #2 (permalink)  
Old 02-16-2009
Autocross.US's Avatar
Registered User
 

Join Date: Nov 2008
Location: Chesapeake, VA
Posts: 73
from the command line, run this one-liner in the same directory as the .JPG files:


Code:
for i in *.JPG ; do NAME=${i%%.*}; mv $i $NAME.jpg ; done

  #3 (permalink)  
Old 02-16-2009
Registered User
 

Join Date: Feb 2009
Posts: 3
Problematic

andrew@andrew-desktop:~/Desktop$ for i in *.JPG ; do NAME=${i%%.*}; mv $i $NAME.jpg ; done
mv: target `snowflake.jpg' is not a directory
mv: target `F40.jpg' is not a directory
mv: target `black.jpg' is not a directory
  #4 (permalink)  
Old 02-16-2009
pludi's Avatar
pludi pludi is online now Forum Staff  
Moderator
 

Join Date: Dec 2008
Location: .at
Posts: 2,595
Since you're on Linux, this could work
Code:
rename .JPG .jpg *.JPG

Note that the rename utility isn't available on (most) other UNIXes, I have only seen it on Linux thus far.
  #5 (permalink)  
Old 02-16-2009
Registered User
 

Join Date: Feb 2009
Posts: 3
:/

andrew@andrew-desktop:~/Desktop$ rename .JPG .jpg *.JPG
syntax error at (eval 1) line 1, near "."


Sorry for the n00bishness, you guys. Still trying to learn more about the command line.
  #6 (permalink)  
Old 02-17-2009
pludi's Avatar
pludi pludi is online now Forum Staff  
Moderator
 

Join Date: Dec 2008
Location: .at
Posts: 2,595
Post the output of
Code:
$ file `which rename`
$ file /usr/bin/prename

The problem is that the usage of the rename utility isn't stable, and can even differ between distributions released at the (roughly) same time.
  #7 (permalink)  
Old 02-17-2009
Registered User
 

Join Date: Apr 2008
Location: Frankfurt a.M.
Posts: 84
for i in *.JPG; do mv ${i} `echo ${i} | sed 's/JPG/jpg/'`; done
Sponsored Links
Closed Thread

Bookmarks

Tags
camera, file extention

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
changing filename extension Hiso Shell Programming and Scripting 3 01-24-2009 09:02 AM
Changing the extension of the file mazhar803 UNIX for Dummies Questions & Answers 4 08-29-2008 10:20 AM
How to get file extension shirleyeow Shell Programming and Scripting 17 01-17-2008 08:40 AM
Changing extension mohan705 Shell Programming and Scripting 4 06-30-2007 02:06 PM
Lynx - Downloading - extension handling - changing mime type? yitzle UNIX for Dummies Questions & Answers 2 10-18-2006 12:46 AM



All times are GMT -4. The time now is 01:21 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0