Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

PkennethV

macrumors 6502a
Original poster
Aug 16, 2006
853
9
Toronto
I'd like to make a list of DVDs that I have used for storage and the files that each disk contain (probably in Excel). Is there a way that I can *easily* just paste the list of files in each disk into Excel without copying and pasting the name of each file manually?

thanks, this will save me a lot of time.
 
Terminal.App
cd /to/the/directory/or/disk
ls(will fit as many as possible on each line) ls -1( will fit one file name per line)

Hope this helps.
 
Terminal.App
cd /to/the/directory/or/disk
ls(will fit as many as possible on each line) ls -1( will fit one file name per line)

Hope this helps.



thanks...but I'm a complete Terminal noob. Can someone please clarify what i need to change/replace in
cd /to/the/directory/or/disk
and where does the "-1" go? Or if you can link me to a page that explains that, that would be helpful too.
 
thanks...but I'm a complete Terminal noob. Can someone please clarify what i need to change/replace in
cd /to/the/directory/or/disk
and where does the "-1" go? Or if you can link me to a page that explains that, that would be helpful too.

cd is "change directory." It gets you to the path you want. So you need to cd to the folder where you want to list files.

For instance, if your files were in your Movies folder in your home directory, you'd:

cd ~/Movies

~ is short for the home folder. If they were in a folder called "Movies" on some other drive called "Stuff," you'd:

cd /Volumes/Stuff/Movies

Basically that gets you to where your files are.

Then, ls is the "list" command, and -b is just an operator for it (bare list format, so it only lists file names). The > tells the shell to output the ls's command to a file instead of the screen, and then you put the name of the file, so:

ls -b > list.txt

Will create a file called list.txt that lists all the files in that directory, one on each line, just the file name.
 
thanks...but I'm a complete Terminal noob. Can someone please clarify what i need to change/replace in
cd /to/the/directory/or/disk
and where does the "-1" go? Or if you can link me to a page that explains that, that would be helpful too.

"-1" switch for ls tells ls to only print 1 file per line, which would be useful for an Excel spreadsheet.
 
How to I Change Directory to a DVD? Let's say I have a DVD called My Disk. I've tried
cd /volumes/My Disk
and
cd ~/Desktop/My Disk
stil doesn't work:eek:
 
type ls /Volumes/ that should list all of the currently mounted filesystems it sees. It is probably the name of the disk or something similar
 
How to I Change Directory to a DVD? Let's say I have a DVD called My Disk. I've tried
cd /volumes/My Disk
and
cd ~/Desktop/My Disk
stil doesn't work:eek:

You cannot have spaces in a path, you have to escape them out. So:

cd /Volumes/My\ Disk

That disk doesn't actually live in your desktop, it lives in /Volumes. Your desktop just shows mounted volumes.

You can also use tab-complete to get to things you're not sure how to type, So, for instance you could type simply:

cd /Vol

then hit the tab key, and it'd fill it in to say:

cd /Volumes

Then you could add on:

cd /Volumes/My

and hit tab, and it'd fill in:

cd /Volumes/My\ Disk
 
I feel really bad still not being able to do this:eek: I'm now able to cd to the disk. But then obviously when I type in
-b > list.txt
it says that I can't make a text file there because the DVD is read-only (duh!). So...how do I change the where the text file will be created (desktop)?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.