Instructions
- Open Terminal by following the directions linked below for your operating system:
- Type your chosen command. After the command, type a space, the greater than symbol (>), and another space. Then, type the name for the file that you wish to generate. Lastly, type a space and then 2>&1. Press Enter/return to submit the command.
EXAMPLE:
ping www.ttu.edu > filename.txt 2>&1
Here is an example screenshot from Windows:
Here is an example screenshot from macOS:
Outcome
The results of the command are exported to the file you specified. Unless you specified a file path, the file is saved in the root of your user profile folder. This is true for both macOS and Windows, even if the command was run with administrative privileges.
TIP: To control where the file is saved, you can alter the command to include the path on your computer where you wish to save the file.
TIP: If there is a space in the file path or file name in Windows, just surround the entire path and file name in quotation marks.
EXAMPLE:
ping www.ttu.edu > "c:\users\jdoe\desktop\ping results.txt" 2>&1
TIP: If there is a space in the file path or file name in macOS, place a backslash in front of the space.
EXAMPLE:
ping -c 10 www.ttu.edu > /Users/jdoe/Desktop/ping\ results.txt 2>&1