

Of course, to look at the output, you'll still need to go to that file and open it.

If the document "files.txt" already exists, then this command will overwrite it with the output of the "ls" command, but you can use two greater-than symbols ("ls > ~/Desktop/files.txt") to append new output to the end of the file instead of overwriting. By default this list will display in the Terminal, but if you use the following command it will save the listed items in a file called "files.txt" located on your Desktop: One common approach to saving Terminal output is to redirect it to a file on disk, which can be done by appending to the command a greater-than symbol followed by a path to the file where you would like to save the output.įor instance, the command "ls" will list the current directory's contents. Standard commands result in output being send to the Terminal window so you can see them (click for larger view). If you are intending to use this output for something you can copy and paste it into another file, but there are other ways to save the information that you may find helpful. By default this output is send to the Terminal window, where it is displayed for you to see before the command exits and drops you back to the command prompt. When you run commands in the OS X Terminal, they will usually output some result, such as the information you are trying to look up, or status details about the command being run.
