Printing a list of file folders

Joined
Mar 8, 2009
Messages
30
Reaction score
0
Points
6
Location
Mansura, LA
Your Mac's Specs
27" iMac
I have about 50 files on my 1tb external HDD. Is there a way I can print a list of the file names without having to re type them in Pages. They are names of video files I have and I need to make a list of them. Any help would be very appreciated.
 
Joined
May 22, 2005
Messages
2,159
Reaction score
67
Points
48
Location
Closer than you think.
Your Mac's Specs
Performa 6116 2GBSCSI 8MB OS 7.5.3
Open Terminal

Type the command below. Modify the paths and/or filename to suit you.

ls path/to/directory/to/print >> ~/Documents/filename.txt

Open file with Text Edit and copy contents into Pages.
 
OP
S
Joined
Mar 8, 2009
Messages
30
Reaction score
0
Points
6
Location
Mansura, LA
Your Mac's Specs
27" iMac
I have not messed with Terminal before.
 
Joined
Jul 9, 2009
Messages
356
Reaction score
3
Points
18
Location
Colorado
Here's an example. I want to print a list of files in my home directory which is called

/Users/mark

So I enter into terminal

$ ls /Users/Mark >> ~/Documents/home.txt

(The $ is the prompt Terminal gives you to tell you it is ready for a command. The symbol ~ is shorthand for your home directory = /Users/mark)

And the file home.txt is then created in my Documents folder and looks like:

Desktop
Documents
Downloads
Library
Movies
Music
Pictures
Public
Screen shot 2009-10-30 at 7.05.54 AM.png
Sites
SketchUpDrawings
untitled folder
 
OP
S
Joined
Mar 8, 2009
Messages
30
Reaction score
0
Points
6
Location
Mansura, LA
Your Mac's Specs
27" iMac
I don't mean to sound totally stupid but I still don't understand.
 
Joined
Jul 9, 2009
Messages
356
Reaction score
3
Points
18
Location
Colorado
No problem.

Do you know how to start up Terminal? You can find it under Applications, Utilities. Open up Finder (should be on your dock) and on the left side you'll see Applications. Click that and scroll down until you see Utilities. Click that and scroll down to Terminal. Click that and a window will open up.

Two lines will be displayed something like this:

Last login: Wed Dec 23 17:47:44 on ttys000
mbohn-macbook-pro:~ mbohn$

There will be a cursor just past the $ sign.

Type in ls (that is a lower case "ell") and Terminal will list the files in your home directory.

To get that information into a file instead of into the Terminal window:

$ ls >> filelist.txt

So the file filelist.txt will now have your list of files.

The trick here is going to be for you to find the directory you want to list. If you can navigate in Terminal to that directory you are all set. The command above will do what you want and the file filelist.txt will end up in that directory. If you don't know how to navigate in Terminal you can put the directory name in like we did before:

$ ls /Users/Mark >> ~/Documents/home.txt
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
ls won't output the filenames under directories, however du will...

so

du -sch /path/to/folder

would work better IMO, course you can also just print directly from the command line

du -sch /path/to/folder | lp

should send it to your printer
 
OP
S
Joined
Mar 8, 2009
Messages
30
Reaction score
0
Points
6
Location
Mansura, LA
Your Mac's Specs
27" iMac
Do I use the external HDD name. It is "Iomega"
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
in that case it'd likely be

du -ach /Volumes/Iomega/* | lp

to print directly to a printer

that will print ALL files in that path...
 
Joined
May 22, 2005
Messages
2,159
Reaction score
67
Points
48
Location
Closer than you think.
Your Mac's Specs
Performa 6116 2GBSCSI 8MB OS 7.5.3
Avoid the Terminal all together if there are no directories, just a list of files.

Open Iomega and do a Select All, then Copy
Open Text Edit
Format menu > Make Plain Text
Paste

There is your file list.
 
Joined
Jul 30, 2009
Messages
7,295
Reaction score
301
Points
83
Location
Wisconsin
Your Mac's Specs
Mac Mini (Late 2014) 2.6GHz Intel Core i5 Memory: 8GB 1600MHz DDR3
If you don't want to mess with Terminal, or install other software, there is a slightly less labor intensive way to do this than re-typing everything: copy and paste. Open the folder you want to list, and your Text Editor. Highlight a file/folder name, Cmd-C, switch to the Text Editor, Cmd-V. Do this until all of them are listed in your new file, then print it.
 
OP
S
Joined
Mar 8, 2009
Messages
30
Reaction score
0
Points
6
Location
Mansura, LA
Your Mac's Specs
27" iMac
Thanks MacsWork. That was very simple.
 
Joined
Jul 30, 2009
Messages
7,295
Reaction score
301
Points
83
Location
Wisconsin
Your Mac's Specs
Mac Mini (Late 2014) 2.6GHz Intel Core i5 Memory: 8GB 1600MHz DDR3
Yeah, I missed that. Great tip!

That works within any folder, right?

So, even if you have multiple "directories" you just have to do that in each one.

(See, I did read it carefully, the second time!) ;)
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top