LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-20-2006, 10:34 PM   #1
Cripple
LQ Newbie
 
Registered: Oct 2005
Location: New Zealand
Distribution: Debian 3.1, College Linux
Posts: 12

Rep: Reputation: 0
Reinstating a files extension


I am dual booting linux with WinXP. I was/am storing a large amount of digital images (100+ images from camera) in linux, where I decided to rename all the files. The file names started off as something like image09.jpg where I would rename it as something like House. But in the process of renaming it, the file extension (.jpg or suchlike) was deleted. Linux didn't mind this, and still recognised the file as an image. But when I try to load the images back into XP, it doesnt recognise the file as being an image and so gives it an extension of FILE.

By renaming the image (in XP) with .jpg on the end, XP will recognise it. Same happens if I load the file into an image viewer. But renaming the file with the extension .jpg (or whatever) is time consuming and annoying.

Is there a way in linux to reinstate the file extension without having to go through and rename the images? Or does anyone no of any way of doing the same in XP? Any help will be much appreciated and I hope what I have written makes sense.
 
Old 01-20-2006, 10:42 PM   #2
damicatz
Member
 
Registered: May 2004
Distribution: FreeBSD 7, Debian "Squeeze", OpenBSD 4.5
Posts: 167

Rep: Reputation: 30
This should do the trick :
for X in *; do mv $X $X.jpg; done

Make sure you run it only in the directories where the files are you wish to rename. Running it in a directory that has stuff you do not want to have a .jpg extension would be a bad thing as it will add .jpg to everything in the current directory.

Last edited by damicatz; 01-20-2006 at 10:47 PM.
 
Old 01-21-2006, 07:50 AM   #3
nitinatindore
Member
 
Registered: Dec 2004
Location: India
Distribution: Mandrake, Mandriva, PclinuxOS
Posts: 114

Rep: Reputation: 15
If you are using KDE than this is what you need:

"krename" command
 
Old 01-22-2006, 05:12 PM   #4
Cripple
LQ Newbie
 
Registered: Oct 2005
Location: New Zealand
Distribution: Debian 3.1, College Linux
Posts: 12

Original Poster
Rep: Reputation: 0
Cheers- that worked fine. Thanks for your help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
remove all files with same extension? scratchnz Linux - General 1 11-04-2005 04:40 AM
Extension files BC1 Linux - Software 5 12-20-2004 04:41 AM
What to do about these files with .new extension? Slovak Slackware 1 11-23-2004 05:50 PM
How program to read files with extension .dat y .cfg files COMTRADE in fedora 1? ivonne Linux - Software 0 11-22-2004 12:42 PM
Reinstating LILO lectraplayer Linux - Software 3 04-18-2004 06:47 PM


All times are GMT -5. The time now is 04:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration