One downside of the GUIs (Graphical User Interfaces) used on most computers is that it can be difficult to directly copy lists of files within folders. However it is relatively straightforward to generate a such a list.
Before use the facility has to be enabled.
To enable this facility you need to download the OpenTerminalHere service from
After unzipping, copy the Open Terminal Here.workflow file into the Library/Services folder within your user home folder (if the Services folder does not exist at this location, you will have to create it).
Once copied, from the System Preferences… option choose:
Once enabled, enabled [right-click] (or [ctrl-click]) in Finder on the folder for which you want to produce a file list and select Services… then Open Terminal Here from the menu that appears.
To enable this facility, from the System Preferences… option choose:
Once enabled [right-click] (or [ctrl-click]) in Finder on the folder for which you want to produce a file list and select New Terminal at Folder from the menu that appears.
A blank window will appear with a cursor next to a $ prompt (text before the prompt may vary depending upon your username and/or setup). This is the Terminal window. Type the following text and hit enter:
ls > filelist.txt
Once the $ prompt reappears you can close the Terminal window. You will notice in Finder that the folder in question now includes an additional file called filelist or filelist.txt. Double clicking on this opens it in TextEdit to reveal that the file contains an editable list of files in that folder.
By default the list consists of just the file name, however the format of this list can be changed by altering the text typed at the $ prompt.
ls -l > filelist.txt |
produces a list including permissions, owner, file size, last edited date and file name |
ls -R > filelist.txt |
produces list of all files within folder and any subfolders |
Please suggest an improvement
(login needed, link opens in new window)
Your views are welcome and will help other readers of this page.
This is question number 2554, which appears in the following categories: