Export file names to text?

Discussion in 'Mac Basics and Help' started by Enseep, Mar 12, 2008.

  1. Enseep macrumors newbie

    Jul 9, 2006
    Hi all, I was wondering if anyone could point me in the direction of an app (or an option I'm missing in finder) that might be able to export the names of files in a certain folder (and subfolders, if possible) to a text file. I know how to print a list using applescript, but I'd like to be able to have the list in an editable text file. Thanks in advance!
  2. 4JNA macrumors 68000


    Feb 8, 2006
    looking for trash files
    open up terminal (applications>utilities), cd to the folder, and then type;

    ls -R > contents.txt

    this would list all of the files in the current folder and subfolders, and then output the list to 'contents.txt' which will then be saved in the same folder. if you are interested in seeing the hidden files included in the list, the use 'ls -a -R' instead. best of luck.
  3. Kettle.Rider macrumors newbie

    May 13, 2009
    Another way, using TextWrangler

    I'm a big fan of TextWrangler, the free text editor from BareBones Software, maker of BBEdit. Here's a method that works well if you are squeamish about using the Terminal.

    Open a new document in TextWrangler. From the Edit menu, choose Insert / Folder Listing...

    Then navigate to the folder from which you want all the file and folder names and choose it. (It will examine all subfolders as well.) Viola! It even correctly tabs in the various subfolders and file names.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "Do it the easy way, that's hard enough."
    R.I. Keedy, 1924-2005
  4. genu1ne macrumors newbie

    Feb 10, 2007
    Great tip, thanks, just googled for that function :)
  5. BollywooD macrumors 6502


    Apr 27, 2005
    Surfers Paradise
    thanks for that, I was messing around in automator, trying to figure out how to do exactly that.

    UNIX is awesome.

Share This Page