Results 1 to 9 of 9

Thread: rename command

  1. #1
    Join Date
    Dec 2012
    Beans
    1

    rename command

    I am not sure if I am in the right section.

    I have a hard time renaming my music files.

    BreakOut -pWzx4kjQnow.aac
    Ever Blazin' -kPsBxf0TWTw.aac
    Eye Deh a Mi Knee -7s5Upro5cNM.aac
    Fire Links (Intro) -3w1cTe7kgTo.aac
    Give It Up to Me -7lwr-pKRyKY.aac
    Got 2 Luv U Ft. Alexis Jordan.mp3
    Head in the Zone -vdejLiMFkB0.aac
    Head to Toe -JQ_NdiIPdug.aac
    I'll Take You There -LI-FKVp8yPU.aac
    Looga Man. Kid Kurup & jigzagula - Change The Game -t9iPpf1C_d4.aac
    Never Gonna Be the Same -88XdrSasrO8.aac
    Nina Sky - Connection -yLhZZW6NXpI.aac
    Send It On -snmvVWRGrA0.aac
    Straight Up -I2l9W4hGfnQ.aac
    Tami Chynn - All on Me -1fEvNDmbfhc.aac
    Temperature -l2Gf3ZbuKjs.aac
    The Trinity -rRfnPaIyrco.aac
    Wayne Marshall - Yardie Bone -mQ9geNBO9o0.aac
    We Be Burnin' -6Exq3AbaYTY.aac
    weiop@weiop:~/Music/sean_paul$

    How can I rename them to the songs name only?
    I gave up trying with the rename command

    Thanks ahead

  2. #2
    Join Date
    Oct 2006
    Location
    New York
    Beans
    1,118
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: rename command

    Take a look at easytag and picard. Both are programs designed to help in tagging/organizing/naming music files. Not sure if they play well with aac files.
    xubuntu minimal, extensive experience, lshw: http://goo.gl/qCCtn
    blog: http://goo.gl/yLg78
    Linux viruses: http://goo.gl/6OCKA

  3. #3
    Join Date
    Jan 2008
    Location
    Nappanee, IN
    Beans
    602
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: rename command

    On looking at your song list, I can see why you are having troubles. There is no regular expression which can describe the difference between the names of the songs and the additions after the name. I think you may have to bite the bullet and manually rename each song.

  4. #4
    Join Date
    Mar 2009
    Beans
    1,609

    Re: rename command

    Sure there is. Zap everything between the - and the .

    Frankly though there are music apps out there (banshee I think, comes to mind) that can rename your files based on anything you want, and put them into folders based on band or whatever too.
    Help stamp out MBR partition tables. Use GPT instead!

  5. #5
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

  6. #6
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: rename command

    Try:
    Code:
    rename -n 's/(.*) -.*\.(\.*)/$1.$2/' ./*
    Used with the -n option, (p)rename will only print the name of each file that would be renamed. If everything looks good, run the command without the -n option.

    If you are looking for a GUI application, then check out:
    • gprename
    • thunar (file manager)
    • gnome-commander (file manager)
    • purrr
    • pyrenamer
    • gwenrename
    • krename (KDE)

  7. #7
    Join Date
    Jan 2008
    Location
    Nappanee, IN
    Beans
    602
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: rename command

    Hey guys who answered after me. Did you actually look at his names? Some of them have 2 or 3 dashes in the names. Your solutions will zap half of the name on those file names.

  8. #8
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: rename command

    Quote Originally Posted by cwsnyder View Post
    Hey guys who answered after me. Did you actually look at his names? Some of them have 2 or 3 dashes in the names. Your solutions will zap half of the name on those file names.
    I tested the command on the file names posted by the OP and as far as I can tell it works.

    (Most/All ???) Regular expressions are by default greedy.

    http://en.wikipedia.org/wiki/Regular...quantification
    Last edited by sisco311; December 19th, 2012 at 10:53 PM.

  9. #9
    Join Date
    Mar 2009
    Beans
    1,609

    Re: rename command

    But if you match only on the last - then it works.

    Code:
    rename -n 's/(.*) -[^-]*\.(\.*)/$1.$2/' ./*
    Didn't test that, but basically modified the regex supplied by sisco311. Looks like it should work.
    Help stamp out MBR partition tables. Use GPT instead!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •