How To Get File Listings As Text

If you need a file listing to use in a document you can get it by copying and pasting from the Finder if you know a trick. But you can also get file listings as text from the Terminal and then wrap that command into a Shortcut.

Comments: 12 Responses to “How To Get File Listings As Text”

    Sheldon
    2 weeks ago

    Thanks bunches

    Esther
    2 weeks ago

    Wahhhhh... where were you last week??? Do you know what I had to go thru to copy the files? I think I took a screenshot, opened it in Preview so it shows text, and copied the text. Luckily it was only ONE folder, but wow.. I didn't even know that was possible!! THANK YOU!

    Lee Townsend
    2 weeks ago

    Your timing is amazing. I have been trying to do this for the past week. Ta Da and there you are. Thanks!

    Gus
    2 weeks ago

    I use BBEdit and drag the folder from the Finder into the BBEdit document and it does the indenting fro subfolders etc. automatically.

    Al LaPierre
    2 weeks ago

    Thanks Gary, I love it when you get us involved in using the Terminal and Shortcuts, and this was a great application. I had one problem: Using Sonoma 14.4.1 and the zsh shell: I had to put double quotes around the SED command: sed -e "s;[^/]*/;\t;g"
    Single quotes would not work.

    David Kennedy
    2 weeks ago

    Dear Mr. Gary;
    Enough of this please try app Print Window 5.app @ App Store ; i have been using this for years and it has multiple formats for files listings on you mac.
    Thank me now or later.
    Note: you have been around for a number of years and appreciate your MacMost.com website

    Akiva Pearlman
    2 weeks ago

    As Al LaPierre pointed out, running Sonoma 14.4.1, the single quotes do not work; but unlike him, even the double quotation marks do not work. I get the following error message:
    sed: option requires an argument -- e
    usage: sed script [-Ealnru] -i extension]
    [file ...]
    sed [-Eainu] [-i extension] [-e script] ...
    [-f script_file] ... [file ...]

    2 weeks ago

    Akiva: Are you sure you are using zsh, not bash or something else?

    David D
    2 weeks ago

    Is there a reason why the input can't be right clicking a location in Finder? This seems to me to be the most logical input.

    2 weeks ago

    David: Go ahead and try that. I did and I got inconsistent results so I opted for this method.

    Sue Park
    2 weeks ago

    I am wondering why Apple cannot implement this function that I have been asking for many years. For the money they charge, this and many other features and functions should be available and easy to use....

    jimthing
    3 days ago

    Good info Gary. Here's links to Homebrew and the 'Tree' formula you can easily install via Terminal - I think they're likely pertinent, from what Gary mentioned in this video (does similar things, just showing differently - another video idea, lol!):
    https://brew.sh
    https://formulae.brew.sh/formula/tree

Leave a New Comment Related to "How To Get File Listings As Text"

:
:
:
0/500 (500 character limit -- please state your comment succinctly and do not try to get around this limit by posting two comments)