Creating a list of files on MacBook Air

I'd like to be able to create lists of files from folders but can't work out how to do it.


On my old Windows PC I'd open a Command prompt and run a command to list all the files in a folder and redirect the output to a text file, e.g. the following command would list all the files in the directory with just the file names ( the /b option gives 'bare' file names only and >file list.txt puts the list into a text file called file list.txt).


dir /b > filelist.txt



I can't find anything in Terminal commands that would replicate this


MacBook Air 13″, macOS 12.6

Posted on Nov 8, 2022 03:34 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 10, 2022 08:52 PM

Hi jwhargreaves,


Would this work?


ls > filelist.txt


(The "ls" command is the Mac/Linux equivalent of "dir".)

4 replies

Nov 10, 2022 04:53 PM in response to jwhargreaves

Hi jwhargreaves,


A simple way to accomplish what you're seeking is to open the folder in Finder. Use Command+A or Edit - Select All from the menu to select all files. Once selected, use Command+C or Edit - Copy from the menu bar again. Then, open a text-only application such as TextEdit and use Command+V or Edit - Paste and your file names should show in a text list you can then name, save, share or work with as needed.


Regards.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Creating a list of files on MacBook Air

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.