Using Terminal utility to copy filenames

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

  1. mysomeday macrumors newbie

    Mar 16, 2010
    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


    Oct 29, 2006
    ~119W 34N
    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.

    ls -1F > mylisting.txt
    Hope that helps.

Share This Page