Extracting just names of files from Drive, possible?

Discussion in 'macOS' started by Yaja123, May 21, 2007.

  1. Yaja123 macrumors regular

    Joined:
    Mar 19, 2005
    #1
    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.
     
  2. SC68Cal macrumors 68000

    Joined:
    Feb 23, 2006
    #2
    Open terminal.

    find /volumes/name of your external >> output

    That will create a text file, that lists all the files
     
  3. redeye be macrumors 65816

    redeye be

    Joined:
    Jan 27, 2005
    Location:
    BXL
    #3
    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 :)
     
  4. Yaja123 thread starter macrumors regular

    Joined:
    Mar 19, 2005
    #4
    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!
     
  5. janey macrumors 603

    janey

    Joined:
    Dec 20, 2002
    Location:
    sunny los angeles
    #5
    try "find /volumes/media\ 1 > ~/Desktop/output.txt" or something like that.
     
  6. Yaja123 thread starter macrumors regular

    Joined:
    Mar 19, 2005
    #6
    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.
     
  7. redeye be macrumors 65816

    redeye be

    Joined:
    Jan 27, 2005
    Location:
    BXL
    #7
    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
     
  8. Yaja123 thread starter macrumors regular

    Joined:
    Mar 19, 2005
    #8
    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? :eek:
     
  9. janey macrumors 603

    janey

    Joined:
    Dec 20, 2002
    Location:
    sunny los angeles
    #9
    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. :eek: which means most of the time, actually bothering to use completion slows me down dramatically.
     
  10. Yaja123 thread starter macrumors regular

    Joined:
    Mar 19, 2005
    #10
    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.
     
  11. SC68Cal macrumors 68000

    Joined:
    Feb 23, 2006
    #11
    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/
     

Share This Page