Beginner's Cheatsheet for Mac User.

Here is a brief Mac cheat sheet that covers some commonly used commands and concepts:

Navigation

  • pwd: Print current working directory
  • ls: List contents of current directory
  • cd: Change directory
  • mkdir: Create a new directory
  • rmdir: Remove a directory
  • rm: Remove a file
  • cp: Copy a file or directory
  • mv: Move or rename a file or directory

File Operations

  • cat: Display contents of a file
  • less: Display contents of a file one page at a time
  • head: Display first few lines of a file
  • tail: Display last few lines of a file
  • touch: Create an empty file or update the modification time of an existing file
  • chmod: Change permissions of a file or directory
  • chown: Change ownership of a file or directory

System Information

  • uname: Print system information
  • uptime: Print system uptime
  • df: Show disk usage
  • du: Show disk usage of a directory
  • top: Display system processes and their resource usage

Networking

  • ping: Test network connectivity to a host
  • traceroute: Show the network path to a host
  • ifconfig: Display network interface information
  • netstat: Display network connections and their status

Package Management

  • brew: Install, remove, or update packages

Users and Groups

  • dscl: Add, modify, or remove a user or group
  • sudo: Run a command with administrative privileges

Miscellaneous

  • history: Show command history
  • grep: Search for a pattern in a file or output
  • tar: Create or extract a compressed archive
  • ssh: Connect to a remote system via SSH

This cheat sheet only scratches the surface of what's possible with macOS, but it should give you a good starting point for working with the command line.