I would like to be able to get a list of the file names in a directory put into a file. Then I would be able to print the file, or re-arrange names in the file. I am creating a cook book, so there are a lot of recipes (individual files). I would like to group and re-group them, so that eventually I can create a table of contents. I remember in Win10 I found out how to make a little app that I then accessed by left clicking on a directory name. Could that be done in Mint 20.x Cinnamon?
Dell Inspiron 660 (2013) I5-3330 4Gb 1T hdd Linux Mint 20 64-bit Cinnamon desktop
SOLVED: Print Directory list to a file
Forum rules
Do not post support questions here. Before you post read: Where to post ideas & feature requests
Do not post support questions here. Before you post read: Where to post ideas & feature requests
SOLVED: Print Directory list to a file
Last edited by quartchug on Sat Jan 02, 2021 5:42 pm, edited 1 time in total.
Re: Print Directory list to a file
This should be doable from the terminal.
Navigate to the folder you want to print the files to (or if you're using Cinnamon, then you can use the file explorer to go to the folder you want and right click and pick 'Open in terminal')
Then from the terminal use:
That will write all the files and directories into a file named filelist.txt on your desktop. You can change the path and filename of the file you want to write to to whatever you want.
Navigate to the folder you want to print the files to (or if you're using Cinnamon, then you can use the file explorer to go to the folder you want and right click and pick 'Open in terminal')
Then from the terminal use:
Code: Select all
ls -a >> ~/Desktop/filelist.txt
- Lady Fitzgerald
- Level 15
- Posts: 5805
- Joined: Tue Jan 07, 2020 3:12 pm
- Location: AZ, SSA (Squabbling States of America)
Re: Print Directory list to a file
I use a program called Filelistcreator. This link describes what it is and how to use it: https://www.ghacks.net/2020/01/28/filel ... and-linux/. However, the link provided is for Windows. You can get the Debian package for installing from https://www.sttmedia.com/filelistcreator-download.
Jeannie
To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
Re: Print Directory list to a file
Alternatively, open the directory in Nemo, press Ctl+A to select all, Ctl+C to copy, then open Text Editor, in a blank text file press Ctl+V to paste - et voila! Save the text file and there you have a full list of all files in that directory. To get rid of the path press Ctl+H for the "replace" function and type in "/home/username/Downloads/" (where username is whatever yours is) and leave the "Replace with" dialog empty.
If you need to, you can re-sort the filename list alphabetically in Libreoffice or, to save work, just sort the folder contents the way you want in Nemo to start with e.g. Name, Date Modified...
If you need to, you can re-sort the filename list alphabetically in Libreoffice or, to save work, just sort the folder contents the way you want in Nemo to start with e.g. Name, Date Modified...
Re: Print Directory list to a file
These are great products that fill that space. I would like to see the next distribution have it as a native GUI application. Thanks for your thoughts!
- henderson_bay329
- Level 1
- Posts: 48
- Joined: Sun Apr 18, 2021 11:45 am
Re: Print Directory list to a file
Just what I needed! Also, in LM 20, I was able to open successive folders, then terminals, and using the up arrow, replicate the command as given above in each successive terminal (i.e., command ls -a >> ~/Desktop/filelist.txt was "remembered" after closing each terminal session, and available to use in the next!). That's NICE! Thanks!ugly wrote: ⤴Fri Jan 01, 2021 2:30 am This should be doable from the terminal.
Navigate to the folder you want to print the files to (or if you're using Cinnamon, then you can use the file explorer to go to the folder you want and right click and pick 'Open in terminal')
Then from the terminal use:That will write all the files and directories into a file named filelist.txt on your desktop. You can change the path and filename of the file you want to write to to whatever you want.Code: Select all
ls -a >> ~/Desktop/filelist.txt