Publishers of technology books, eBooks, and videos for creative people

Home > Articles

  • Print
  • + Share This
This chapter is from the book

Reference 4.5 Command-Line Tips and Tricks

Here are some command-line tips that help you customize your experience and save time:

arr.jpg Control-click a command and choose Open man Page to read more about that command.

p0096_01.jpg

arr.jpg If your Mac has a Touch Bar, type a command and press the button for that command in the Touch Bar to view the man page. The figure shows the Touch Bar displaying a button for the defaults command man page.

arr.jpg Use Tab key completion when you enter file paths.

arr.jpg Drag and drop files and folders from the Finder to Terminal to automatically enter their locations at the command line.

arr.jpg Type open . (“open” followed by a space, followed by a period) at the prompt to open your current command-line location in the Finder.

arr.jpgExplore Terminal preferences (from the menu bar, choose Terminal > Preferences or press Command-Comma) to customize the look and feel of your command line.

arr.jpg To cancel a command or clear your current command entry, use Control-C.

arr.jpg You can edit commands before submitting. The Left and Right Arrow keys and the Delete key work as you would expect.

arr.jpg At the command prompt, use the Up Arrow and Down Arrow keys to view and reuse your command history. This includes editing old commands before rerunning them. Enter the history command to see your recent command history.

arr.jpg To clear the Terminal screen, enter the clear command or press Control-L.

arr.jpg To move the cursor to the beginning of the current line, press Control-A.

arr.jpg To move the cursor to the end of the current line, press Control-E.

arr.jpg To move the cursor forward one word, press Esc-F.

arr.jpg To move the cursor back one word of the line, press Esc-B.

arr.jpg To move the cursor to a location in a command string, Option-click where you’d like the cursor to be.

arr.jpg Use the inspector to view and manage running processes, and edit window titles and background colors. To open the inspector, press Command-I. To send a command to a process, select it, click the action pop-up menu, then choose a command from the Signal Process Group.

For more information about Terminal, read Terminal Help at support.apple.com/guide/terminal/welcome.

  • + Share This
  • 🔖 Save To Your Account