Forum rules
Before you post please read how to get help


Postby xibalba on Sat Mar 24, 2012 6:24 pm

Last edited by xibalba on Fri Nov 27, 2015 9:33 pm, edited 2 times in total.
Level 2
Level 2
Posts: 74
Joined: Wed Jan 05, 2011 6:07 pm

Linux Mint is funded by ads and donations.

Re: Adding file extensions to files lacking them

Postby Habitual on Sat Mar 24, 2012 6:50 pm

Code: Select all
for f in 00*; do mv $f `basename $f `.jpg; done;

NOTE: I wouldn't run this command in /home/$user directory.
I would move 00? to a /home/$user/test directory and run it from there.
I will defend your right to make a choice.
But you must defend the choice you made.
User avatar
Level 10
Level 10
Posts: 3129
Joined: Sun Nov 21, 2010 8:31 pm
Location: Youngstown, Ohio

Re: Adding file extensions to files lacking them

Postby rhodry on Sun Mar 25, 2012 9:57 pm

I know this is past the time restraint mentioned but, just for future reference you can also:

run 'mc' file manager. Also known as 'old faithful', 'tried & true', 'mr wonderful', etc etc etc :)

Have both columns in same directory.
Highlight all required files in one column, then press F6 for rename/move and in 2nd line option ( the where to line) just put *.jpg. Done.

Not explained too eloquently, but seriously folks there is not a Linux install on the planet that should not have 'mc' file manager installed!! :)

Life isn't about waiting for the storm to pass...
it's about learning to dance in the rain.
Level 4
Level 4
Posts: 346
Joined: Mon Jun 04, 2007 7:32 am

Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest