Terminal Cheatsheet

terminal
cheatsheet
A quick reference guide for common terminal commands in Zsh/Bash and PowerShell.
Author
Published

10 September 2024

Zsh/Bash ( Mac)

File Operations

  • cat [file]: Display the contents of a file
  • cp [source] [destination]: Copy a file or directory
  • mv [source] [destination]: Move or rename a file or directory
  • grep [pattern] [file]: Search for a pattern in a file
  • chmod [permissions] [file]: Change file permissions

Process Management

  • ps: List running processes
  • kill [PID]: Terminate a process
  • top: Display system activity and process information

PowerShell ( Win)

File Operations

  • gc [file]: Get the contents of a file
  • cp [source] [destination]: Copy a file or directory
  • mv [source] [destination]: Move or rename a file or directory
  • sls [pattern] [file]: Search for a pattern in a file
  • icacls [file] /grant [permissions]: Change file permissions

Process Management

  • ps: List running processes
  • kill [PID]: Terminate a process
  • tasklist: Display running tasks