If you use Terminal on your Mac to accomplish simple tasks, there may be a time when you want to print the results. For example, maybe you’re using a Terminal command to list out the apps on your Mac.
While it’s easy enough to print your Terminal window, there are a couple of tricks for selecting what to print. Here, we’ll show you those tips for selecting text and how to print from Terminal on your Mac.
Selecting text in Terminal
After you issue your Terminal command, you may or may not want to print the entire window. For instance, if you’re running several commands, you may only want to print the results from a certain one. You have a few ways to select what you want to print in Terminal.
- Drag your cursor through the text. You can start wherever you like, drag your cursor through, and then print only what’s highlighted.
- Hold your Shift key for adjacent lines. Sometimes dragging through text can be clunky, especially if you have a lot of it. Alternatively, you can select the first line, hold your Shift key, and click the last line. You’ll see only that range highlighted for printing.
- Hold your Command key for non-adjacent lines. If the command lines or results that you want to print are not next to each other, use your Command key instead. Select the first line, hold your Command key, and select the next line. Continue holding Command and selecting the text until everything you need is highlighted for printing.
- Select text between the marks with the Edit menu. If you want to select all lines between the marks in Terminal, you can simply click Edit > Select Between Marks from the menu bar. This will highlight all the lines between your prompt marks.
Printing in Terminal
If you just want to print the entire Terminal window as it is, you can click Shell > Print from the menu bar. You’ll see a preview of the pages ahead of time and can print them all or just a range. Click Print.
But if you want to print the text you select using one of the above methods, click Shell > Print Selection from the menu bar. Again, you’ll see a preview and can adjust the pages or just hit Print.
Wrapping it up
We don’t always want to print everything we see. Whether it’s the results of a command, the command itself, or everything between the prompt marks, you can select what you need and print it easily from Terminal on your Mac.
Do you have any simple tips like this for printing on Mac? Let us know!