ZSH
Useful ZSH Commands
NOTE: The following commands are largely the same as BASH commands, since they're both UNIX-based shells.
Basic Commands
Change the Current Directory
List Directory Contents
Move or Rename Directories
Remove Files Directories
Set an Environment Variable
Display an Environment Variable
Open a Directory in Finder (Mac)
Display an Entire File
Display the First N Lines of a File
Fist 10 Lines:
First 5 Lines:
Show Command History
Clear Terminal History
Ensure only one terminal window is open.
Run the command below:
Close the terminal window.
Quit the terminal app by right-clicking the app icon and selecting βQuitβ.
Open a terminal window.
Run the command below to ensure your
.zsh_history
is empty.
Clear Clipboard Content
List Local IP Address
The following command lists all local, non-loopback IPv4 addresses. Each IP address corresponds to a different network interface or network configuration on your machine.
List Public IP Address
SSH
Access a remote machine via SSH.
Exit SSH Session.
In case your shell does not display user@hostname
, the following are commands to check this information.
Check the current user's username:
Check the current machine's hostname:
Last updated
Was this helpful?