Using Terminal utility to copy filenames

Discussion in 'macOS' started by mysomeday, Mar 16, 2010.

  1. mysomeday macrumors newbie

    Joined:
    Mar 16, 2010
    #1
    I have a folder on my desktop with 100's of images. I'm trying to copy just the titles of those images to a text list. Someone suggested I use terminal but I can't seem to figure out the right line of command to produce a text list.

    Can anyone help?
     
  2. gr8tfly macrumors 603

    gr8tfly

    Joined:
    Oct 29, 2006
    Location:
    ~119W 34N
    #2
    Code:
    ls -1F
    might work for you. It outputs one file/line and adds a suffix to denote directories, executables, etc.

    For other options, check "ls" man page. ("man ls")

    Note the command outputs to standard output (the Terminal window). If you want it to be directed to a text file add " > mylisting.txt" to the command.

    Example:
    Code:
    ls -1F > mylisting.txt
    Hope that helps.
     

Share This Page