How to print folder content

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Pinokkio
Level 2
Level 2
Posts: 75
Joined: Thu Mar 09, 2017 3:25 am

How to print folder content

Post by Pinokkio »

Hello , how can I print the full content of a folder ( also the ones not visible on screen ) .I need this to quickly browse what is on the different sticks and HD's .
Of course I could make two or more print screens , but I am looking for a more elegant and more simple way .
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: How to print folder content

Post by JoeFootball »

Pinokkio wrote: ... I am looking for a more elegant and more simple way .
I don't know about elegant, but here's a simple way to collect all the file names together for printing.

In Nemo, navigate to the top directory of where you want to capture all the file names there and below it. Right-click within there, and select "Open in Terminal". Then enter ls -R > my_file_names.txt, and all the recursive directory output will be captured in that new file for printing.
Pinokkio
Level 2
Level 2
Posts: 75
Joined: Thu Mar 09, 2017 3:25 am

SOLVED How to print folder content

Post by Pinokkio »

Thanks a lot ! OH boy ...so simple if you know it ...
User avatar
absque fenestris
Level 12
Level 12
Posts: 4110
Joined: Sat Nov 12, 2016 8:42 pm
Location: Confoederatio Helvetica

Re: How to print folder content

Post by absque fenestris »

You could also use tree.
If tree is not yet loaded on your system, you can use the command sudo apt install tree.

Open any folder. Open the terminal with a right-click and enter the command tree and you have a treeview of the entire folder content.
If you want to save the treeview as a text file, enter the command tree -no my_file_names.txt
Otherwise everything as described by JoeFootball above ...

https://www.computerhope.com/unix/tree.htm

If you want it in color, enter tree and select in the Terminal Menu: Edit > Select All, then > Copy as HTML. If you paste it into an open LO Writer document it looks quite acceptable > see the screenshot at the bottom.

Image

Image
Locked

Return to “Cinnamon”