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

Yaja123

macrumors regular
Original poster
is there a way of quickly/automating the extracting just the names of the files on a hard drive? say, into a text file?

i have a usb external drive and id love to know what i have on it as a reference to keep on my mac.

i think there is a way, maybe an automator script?

anyone done this?

thanks.
 
Open terminal.

find /volumes/name of your external >> output

That will create a text file, that lists all the files
 
You could use a terminal command to do this.
(Applications/Utilities/Terminal)
type
Code:
find /Volumes/[COLOR="Gray"]nameofyourexternal[/COLOR]/* > ~/Documents/[COLOR="gray"]nameofthefile[/COLOR].txt

Cheers

edit: beaten to it 🙂
 
thanks... but more help

i typed in
find/volumes/media 1 >> output
and got reply
-bash: find/volumes/media: No such file or directory

can you clarify what im doing wrong?

the name of the external drive is Media 1. well, this is the name of the partition. its a lacie mobile drive with media 1 and media 2 as partitions if that helps.

im not up to speed in computer speak so if you can spell out exactly what i need to do - great!
 
wicked! 🙂

i changed the name of the volume to just 'media' and it produced the text file as per redeye's instructions - perfect!

thank you all.
 
try "find /volumes/media\ 1 > ~/Desktop/output.txt" or something like that.
A cool thing in terminal is command completion. You will also have to take care of Capitals and stuff.
type:
find /V (press tab) it will complete to /Volumes (capitals!)
now you have
find /Volumes type /me or /Me
find /Volumes/Me (press tab)
and then add the rest.

Files and folder names are case sensitive. Also make sure there is a space between find and the first /

Edit:
pff there I go typing stuff, and it's not even needed.
Looks like I'm always 3 minutes to late.

Well, glad you got what you wanted
 
thanks again.

im going to mess around with it today and try your auto complete tip because this will be a regular task.

ps. i havent used the word 'wicked' since the 1980's!! i guess this little trick got me excited!! so does this mean im a geek? 😱
 
A cool thing in terminal is command completion.
it's useful, but when i already know the volume name i can't be bothered to use shift to capitalize it when i can just type really fast in lowercase. 😱 which means most of the time, actually bothering to use completion slows me down dramatically.
 
one more

is it possible to make the txt file name "Media1 @ 070521"?
or something along the lines of auto adding date to file name?

at the moment ive just put "find /Volumes/Media1/* > ~/Documents/media1.txt" into my quicksilver shelf for easy paste

thanks.
 
If you're going to be using terminal frequently, it would be best to know the character escape

Just place a \ in front of whatever character (like a space) that you want to escape.

So for example, for photoshop:

cd /applications/Adobe\ Photoshop/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.