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.
Want to know more about how to use Shortcuts on your Mac? Check out this MacMost course!
Comments: 13 Responses to “How To Get File Listings As Text”
Sheldon
7 months ago
Thanks bunches
Esther
7 months 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
7 months ago
Your timing is amazing. I have been trying to do this for the past week. Ta Da and there you are. Thanks!
Gus
7 months 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
7 months 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
7 months 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
7 months 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 ...]
David: Go ahead and try that. I did and I got inconsistent results so I opted for this method.
Sue Park
7 months 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
6 months 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
Nelson Silva
5 months ago
Thanks for your amazing work as always!!! You are a "life" savior!!! Help me out a lot!!! Everything im learning on MacOs its with you Gary!!!
Leave a New Comment Related to "How To Get File Listings As Text"
Thanks bunches
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!
Your timing is amazing. I have been trying to do this for the past week. Ta Da and there you are. Thanks!
I use BBEdit and drag the folder from the Finder into the BBEdit document and it does the indenting fro subfolders etc. automatically.
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.
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
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 ...]
Akiva: Are you sure you are using zsh, not bash or something else?
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.
David: Go ahead and try that. I did and I got inconsistent results so I opted for this method.
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....
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
Thanks for your amazing work as always!!! You are a "life" savior!!! Help me out a lot!!! Everything im learning on MacOs its with you Gary!!!