I'm looking for an easy way to build a list in a txt
file of the filenames inside a given directory. Filenames only preferred, though I could trim other fields if necessary.
In terminal, change directory to the required folder, then use the command:
ls > files.txt
This will redirect a list of the contents of the folder to the text file files.txt
. You didn't indicate what form the contents of the folder takes. If there are sub-folders present, in addition to a group of files, the folder names will also be included. But, once you have the text version you can sort/edit it any way you desire.
No comments:
Post a Comment