Script or application for making list of folders

Discussion in 'Mac Apps and Mac App Store' started by Kralle, Oct 7, 2010.

  1. Kralle macrumors newbie

    Joined:
    Jan 6, 2010
    Location:
    Denmark
    #1
    Hello :apple:-people!

    I'm looking for a script or an application which generates a text-file containing the names of the folders in my Music-directory.

    Does anybody have a suggestion to a script or application which would make my life easier, since I've got tons of folders in there.

    Thanks in advance,
    Kralle
     
  2. mulo macrumors 68020

    mulo

    Joined:
    Aug 22, 2010
    Location:
    Behind you
    #2
    ls ~/Music/iTunes/iTunes\ Media

    or

    ls -l ~/Music/iTunes/iTunes\ Media
     
  3. Kralle thread starter macrumors newbie

    Joined:
    Jan 6, 2010
    Location:
    Denmark
  4. spinnerlys Guest

    spinnerlys

    Joined:
    Sep 7, 2008
    Location:
    forlod bygningen
    #4
    Applications / Utilities / Terminal
    [​IMG]
     
  5. LPZ macrumors 65816

    Joined:
    Jul 11, 2006
    #5
    Try this. Open Terminal (in Utilities) and enter

    Code:
    ls ~/Music/ > ~/Desktop/MusicFolders.txt
    You should get a file named MusicFolders.txt on your Desktop.
     
  6. spinnerlys Guest

    spinnerlys

    Joined:
    Sep 7, 2008
    Location:
    forlod bygningen
    #6
    Add "-l" if you want more information, like folder size and modifying date.

    Code:
    ls [B]-l[/B] ~/Music/ > ~/Desktop/MusicFolders.txt
     
  7. Kralle thread starter macrumors newbie

    Joined:
    Jan 6, 2010
    Location:
    Denmark
    #7
    Thanks for all the replies, guys!

    What I'm looking for are the folders in ~/Music/iTunes/iTunes Media/Music, but what I want is the folders in the Music-folder AND the subfolders in each folder (look at the example with the Amon Amarth-directory):

    [​IMG]

    Although, if I put "ls ~/Music/iTunes/iTunes Media/Music > ~/Desktop/MusicFolders.txt" it says "No such file or directory".

    Thanks in advance.
     
  8. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #8
    That's because you need to either escape the space in "iTunes Music" with a \ in front of the space or, put quotes around the path. The command won't give you a recursive view of the directories though. Or you don't have that specific folder.

    Edit: Try this,
    Code:
    find ~/Music -type d > ~/Desktop/music-directories.txt
    If you only want the folder name at the end,
    Code:
    find ~/Music -type d | sed s'#.*/\(.*\)$#\1#' > ~/Desktop/music-directories.txt
     

Share This Page