Fedora Linux Support Community & Resources Center
Prev Previous Post   Next Post Next
  #1  
Old 10th June 2010, 01:30 AM
kurtdriver Offline
Registered User
 
Join Date: Jul 2005
Location: Vancouver Canada
Posts: 1,285
linuxfedorafirefox
Solved: appending a number at the end of filenames in a Directory

Hi, frustrated with a directory whose filenames all began with numbers, I did this to strip the numbers from them.
Code:
for f in * ; do    mv $f $(echo $f | sed -e "s/[0-9]//g"); done
which removed the numbers from filenames with in directory.
I hadn't thought about the one number at the end (a 3). So now I'm left with a bunch of .mp files
Yeah, I'm laughing too!
I did this
Code:
for f in * ; do    mv $f $(echo $f | sed -e "s/[.mp]/.mp3/g"); done
Which has given each file an extension of .mp3.mp3.mp3
For instance
_-_ZZ_To.mp3_-_Legs.mp3.mp3.mp3
It also added a 3 (as seen above) to the middle of some files.
I was clever enough to preserve each my originals
and the .mp files.
How do I stick a three on the end? Every file in the directory is an .mp3, which might help a bit. Thanks, Kurt

Last edited by kurtdriver; 10th June 2010 at 03:11 AM.
Reply With Quote
 

Tags
appending, directory, end, filenames, number

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Release number trumps Version number ? PabloTwo Programming & Packaging 0 3rd June 2010 05:39 PM
Appending to an ISO via mkisofs InfRecursion Programming & Packaging 3 8th January 2006 04:08 PM
Smaba or Windows is appending .tar to my .tar.gz files BiOPSY Using Fedora 0 24th December 2004 04:04 PM


Current GMT-time: 10:40 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat