How to Use Terminal on a Mac
How to Use Terminal on a Mac GA S REGULAR Menu Lifewire Tech for Humans Newsletter! Search Close GO Computers, Laptops & Tablets > Apple
That command says, "Move (the command) the file TerminalTestFile.rtf (the argument) from my Desktop to my Documents (the output)." In Terminal the tilde character ~ is a shortcut for your Home folder. Both the desktop and the Documents folder exist in the Home folder. Opens the file you specified with the directory path. rm Remove files cp Copy mkdir Make directory ditto Duplicate a file between folders. caffeinate Keeps your computer from going into sleep mode as long as Terminal is open clear Clears the Terminal screen pwd Returns the path to the working directory .. Takes you to the Parent directory man Takes you to the manual page for that command so you can read about the command, what it does, and how to use it. say This command will result in your Mac speaking whatever you wrote after the say command. history View your Terminal command history. history -c Delete your Terminal command history. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Subscribe Tell us why! Other Not enough details Hard to understand Submit More from Lifewire How to Delete a File in Terminal on Your Mac How to Install Android Debug Bridge (ADB) How to Use the Netstat Command on Mac How to Open Command Prompt (Windows 11, 10, 8, 7, etc.) How to Turn off Mouse Acceleration on Mac How to Back Up Your iPhone to an External Hard Drive How to Use Mac Terminal Commands DIRECTORY File (What It Is & How to Open One) How to Make a Bootable Flash Installer of OS X or macOS Environment Variables: What Are They? Net Send Command (Examples, Switches, and More) 21 Best Command Prompt Tricks How to Create an ISO Image From a DVD, CD or BD Disc View Hidden Files and Folders on Your Mac With Terminal How to Save Terminal Commands on a Mac What Is a Redirection Operator? Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. Cookies Settings Accept All Cookies
How to Use Terminal on a Mac
Your complete Mac Terminal tutorial
By Jerri Ledford Jerri Ledford Writer, Editor, Fact Checker Western Kentucky University Gulf Coast Community College Jerri L. Ledford has been writing, editing, and fact-checking tech stories since 1994. Her work has appeared in Computerworld, PC Magazine, Information Today, and many others. lifewire's editorial guidelines Published on April 20, 2020 Tweet Share Email Tweet Share EmailIn This Article
Expand Jump to a Section Start by Opening Terminal The Basics of Terminal Commands Rules for Terminal Commands Using Terminal Commands on a Mac The Terminal app on a Mac is the command line interface that allows you to use Unix commands to accomplish some tasks much faster than you could execute them using the graphical user interface (GUI). Using Terminal commands, you can open files, improve your Mac's performance, and much more. Here's how to use Terminal on a Mac, including some commands to get you started.Start by Opening Terminal
Of course, your first step will be to open Terminal. There are several options to do that, but the easiest is to press Command + Spacebar to open Spotlight, then search for "Terminal." The Top Hit should be the Terminal app. Double-click to open it. When the Terminal window opens, you can resize it by dragging one of the corners to expand. You can also change the look of the app by going to Terminal > Preferences or pressing the Command+, (comma) keyboard combination. In the Profiles dialog box that appears, you can change the appearance of the command windows to match your style or needs. Once your Terminal window has the appearance you prefer, then you can start using it to execute commands on the computer.The Basics of Terminal Commands
You can do a lot of cool (and useful) things with the terminal. For example, if you really want to, you can use a Terminal command to make your Mac speak to you. But before you start, it's helpful to know how Terminal commands are written. Each Terminal command has three parts. The command: This is the actual letters that you'll type into the Terminal window to execute a command. Be very careful when using Terminal commands, because some commands can delete files or cause other damage to your system that might stop your computer from working.An argument: This part of a command tells which resources the command should work on. For example, should a cp, or copy, command copy this window or another?An option that modifies the output: This is a directive about where the results of a specific command should appear. For example, if you want to move a file, you would use the command mv. The argument for that command would be the location of the file you want to move. And the output would be the location you want the file moved to. So to move a file from your desktop to your Documents file might look like this: mv ~/Desktop/TerminalTestFile.rtf ~/DocumentsThat command says, "Move (the command) the file TerminalTestFile.rtf (the argument) from my Desktop to my Documents (the output)." In Terminal the tilde character ~ is a shortcut for your Home folder. Both the desktop and the Documents folder exist in the Home folder.