How to Use Terminal on Mac for Beginners

Learn Terminal basics on Mac. Open Terminal, navigate files, run commands, and master essential shortcuts for macOS command line interface.

  1. Open Terminal. Press Command+Space to open Spotlight search. Type 'Terminal' and press Enter. Alternatively, go to Applications → Utilities → Terminal. A black window with white text appears, showing your username and computer name followed by a dollar sign ($).
  2. Learn your current location. Type 'pwd' and press Enter. This shows your present working directory—where you currently are in your file system. You'll likely see something like '/Users/yourname', which is your home folder. This command helps you understand your starting point.
  3. View folder contents. Type 'ls' and press Enter to list files and folders in your current location. You'll see items like Desktop, Documents, Downloads. Type 'ls -la' for detailed information including hidden files, file sizes, and permissions.
  4. Navigate between folders. Type 'cd Desktop' to move into your Desktop folder. Type 'cd ..' to go up one level to the parent folder. Type 'cd ~' to return to your home folder instantly. Use Tab completion by typing the first few letters of a folder name and pressing Tab.
  5. Create and manage files. Type 'mkdir test_folder' to create a new folder. Type 'touch test_file.txt' to create an empty text file. Type 'rm test_file.txt' to delete a file, or 'rmdir test_folder' to remove an empty folder. Always double-check before deleting anything.
  6. Clear Terminal and access history. Type 'clear' or press Command+K to clear the Terminal window for a fresh start. Press the up arrow key to cycle through previously entered commands. Press down arrow to move forward through your command history.
  7. Get help and exit safely. Type 'man' followed by any command name (like 'man ls') to see its manual page—press Q to exit the manual. Type 'exit' or press Command+Q to close Terminal. If a command seems stuck, press Control+C to cancel it.

Related

  • How to Securely Erase Your Android Phone Before Disposal
  • How to initiate your first Android backup
  • How to Fix Missing Apps After Android Data Transfer
  • How to Fix RCS Messaging Activation Issues on Android
  • Verifying Your Android Device Setup
  • How to check and install Android security updates