Use Terminal on Mac

This wikiHow teaches you how to open the Terminal console on your Mac, and start using Terminal with some basic commands. The Terminal app is Mac's native command-line interface, and allows you to control your computer using line commands. You can quickly view, edit, and open files with some basic Terminal commands. You can also view and read the full manual inside the Terminal window if you want to delve in more, and play with your Mac's settings.

Steps

Opening Terminal

  1. Open your folder. The Applications icon looks like an "A" made out of a pencil and a brush. You can find it on the Dock or on the left-menu of a Finder window.
  2. Open the folder in Applications. The Utilities icon looks like a wrench and a screwdriver on a blue folder. You can find it in your Applications folder.
  3. Double-click in Utilities. The Terminal icon looks like a black square with a white ">_" icon in its corner. This will open the Terminal console in a new window.
    • You can write any command in the Terminal console to control and use your Mac.

Using Basic Commands

  1. Type cd ~/[directory] and press Return. This command navigates you to the specified location. You can replace "[directory]" here with any folder's location path on your computer to go here in Terminal.
    • For example, if you want to navigate to your Documents folder in Terminal, type cd ~/Documents.
    • If you want to open a folder within another folder, separate each folder with a backslash.
    • For example, to go to "Folder1" inside "Documents," use cd ~/Documents/Folder1.
  2. Type pwd and press Return. This will show you the folder path to your working directory. You can view the full directory path to your current folder location here.
    • For example, if you're currently in your Documents folder in Terminal, you'll see /Users/[username]/Documents.
  3. Type ls and press Return. This will show a short list of all the files in this folder.
    • If you want to see a longer list, you can use ls -l for long listing, ls -lh for long listing with human-readable sizes or ls -R for the entire content of the folder recursively.
  4. Type open [filename] and press Return to open a file. You can use this to open any file in your current directory. Replace [filename] here with the name of the file, and it will be opened it in its default application.
    • Make sure to include the file's format extension in the filename.
    • You can list all the files in your current directory with the ls command, and look up the file extension here.
    • For example, to open a TextEdit file named "textfile1," use open textfile1.rtf.
  5. Type open . and press Return. This will open your current folder in a new Finder window. This will allow you to view all the files here in Finder.
  6. Type man [command] and press Return. This will open the manual. Replace "[command]" here with any Terminal command line in order to view all the details about this command.
    • Press q on your keyboard to quit the manual when you're done.
    • Alternatively, you can use info [command] to view more information about any command.
  7. Type clear and press Return. This will clear the Terminal screen.

Tips

  • You can go up to the parent/enclosing directory by cd ...