Results 1 to 6 of 6

Thread: Move all sub folders in a directory up one directory.

  1. #1
    Join Date
    Apr 2007
    Location
    England, United Kingdom
    Beans
    805
    Distro
    Ubuntu 8.04 Hardy Heron

    Question Move all sub folders in a directory up one directory.

    Recently I ripped and converted all my music and like a fool I told it to file in folders like so:

    Artist Name/Album/Artist Name/Album


    So is there anyway to copy the Artist Name (inside the Album Folder) and move it up 2 directories and delete the duplicated folders.


    Hard to explain and understand not understand let me know.

    Saj
    Ubuntu User Since 6.06 - "Here To Help"
    Ubuntu Beta Tester Since 6.10 - "We have the problems so you don't have too."
    --------------------------------------------------
    Linux Registered User: 452642 Ubuntu Registered User: 17365

  2. #2
    Join Date
    Jul 2008
    Beans
    494

    Re: Move all sub folders in a directory up one directory.

    You could do a recursive move:

    navagate to the first Album directory

    cd Artist\ Name/Album/
    then move the second artist name directory to the music directory:

    mv -r Artist\ Name /home/yourname/music/
    You can then delele the now empty first album directory:

    cd ..
    rm Album
    Last edited by keplerspeed; November 9th, 2008 at 12:57 AM.

  3. #3
    Join Date
    Apr 2007
    Location
    England, United Kingdom
    Beans
    805
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Move all sub folders in a directory up one directory.

    That would mean I have to cd into every directory which would not be time efficient. Anyway to do it to alot of folders at once.

    Saj
    Ubuntu User Since 6.06 - "Here To Help"
    Ubuntu Beta Tester Since 6.10 - "We have the problems so you don't have too."
    --------------------------------------------------
    Linux Registered User: 452642 Ubuntu Registered User: 17365

  4. #4
    Join Date
    Apr 2008
    Location
    California Republic
    Beans
    2,657

    Re: Move all sub folders in a directory up one directory.

    open ~/My Music/Artist Name/Album/ select everything, and drag it to ~/My Music

    merge all folders when it asks

    or am i missing something?
    Semper Fi

    My Non-Ubuntu Blog.
    All posts by me are Public Domain.

  5. #5
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Move all sub folders in a directory up one directory.

    use find

    http://content.hccfl.edu/pollock/Unix/FindCmd.htm

    find type -d ./ -exec /bin/cp -R '{}' ..;
    Last edited by bodhi.zazen; November 9th, 2008 at 04:03 AM.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  6. #6
    Join Date
    Apr 2007
    Location
    England, United Kingdom
    Beans
    805
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Move all sub folders in a directory up one directory.

    Quote Originally Posted by earthpigg View Post
    open ~/My Music/Artist Name/Album/ select everything, and drag it to ~/My Music

    merge all folders when it asks

    or am i missing something?

    That would work, but I have around 500 folders like this so doing it that way (manually) would take me ages.

    Saj
    Ubuntu User Since 6.06 - "Here To Help"
    Ubuntu Beta Tester Since 6.10 - "We have the problems so you don't have too."
    --------------------------------------------------
    Linux Registered User: 452642 Ubuntu Registered User: 17365

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
  •