Line
Skip to main content
< All Topics
Print

How to use Terminal in macOS

1. Open Terminal.

  • Go to Applications > Utilities and open Terminal.
  • Or use Spotlight by pressing Cmd + Space, typing Terminal, and pressing Enter.

2. Basic Commands

  • To list the directory contents, you can simply type the command below.

 

  • Or if you want to see what your current folder is, you can use the command.

 

  • Changes the current directory.

 

  • cd ~          # Go to the home folder.
  • cd ..          # Go to the parent folder.
  • cd ../..       # Go up two levels to the grandparent folder.
  • cd /           # Go to the root system folder.
  • Create new files using the touch command.

 

  • Create a new folder using the mkdir command.

 

  • To copy a file or folder, use the cp command by specifying the source file and the destination file.

 

  • To move a file, use the mv command by specifying the file to move and the destination, like cp
  • Display the content of the file using the cat command

 

Credit:  https://medium.devahoy.com/getting-started-with-command-line-for-mac-user-120063dfb655

Messenger