Skip to content

Instantly share code, notes, and snippets.

@MohamedElashri
Created November 6, 2024 13:43
Show Gist options
  • Save MohamedElashri/decaafab5134a2eec60db287ba2bbbc1 to your computer and use it in GitHub Desktop.
Save MohamedElashri/decaafab5134a2eec60db287ba2bbbc1 to your computer and use it in GitHub Desktop.
List of macOS commands in tables categorized by tool types

List of macOS commands in tables categorized by tool types. source

File and Directory Operations

Command Description
cp Copy files to another location
mv Move or rename files or directories
rm Remove files
mkdir Create new folders
ls List files
find Search for files
locate Find files by name
touch Change file timestamps
chmod Change access permissions
chown Change file owner and group
ln Make hard or symbolic links
lsregister Reset the Launch Services database
stat Display the status of a file
file Determine file type
lsof List open files

Network Tools

Command Description
ping Test network connection
ifconfig Configure network interface parameters
netstat Show network status
curl Transfer data from or to a server
ftp Internet file transfer
nc or netcat Read/write data across networks
ssh Secure shell for remote login
scp Secure copy files between hosts
dig DNS lookup
ipconfig View/control IP configuration state
networksetup Configure network settings
traceroute Trace route to host
tcpdump Dump network traffic
airport Manage Apple AirPort

Process and Job Management

Command Description
ps Display process status
top Display active processes
kill Terminate a process by PID
killall Terminate processes by name
fg Move a job to the foreground
bg Send a job to the background
jobs List active jobs
disown Unbind a job from the current session
wait Wait for a process to complete
nice Set priority of a command
nohup Run a command immune to hangups

Disk and Storage Utilities

Command Description
diskutil Disk utilities - Format, Verify, Repair
df Display free disk space
du Estimate file space usage
csrutil Configure System Integrity Protection (SIP)
mount Mount a filesystem
umount Unmount a filesystem
fsck Filesystem consistency check and repair
dd Clone disks
nvram Manipulate firmware variables
mdutil Manage Spotlight metadata

System Configuration and Information

Command Description
system_profiler Report system configuration
sw_vers Print macOS version
hostname Print or set system name
uptime Show how long the system has been running
scutil Manage system configuration parameters
pmset Power management settings
launchctl Load or unload daemons/agents
sysctl Get or set kernel state
csrutil Configure System Integrity Protection (SIP)
defaults Set preferences

Scripting and Shell Tools

Command Description
alias Create an alias
bash Bourne-Again SHell
zsh Z shell
awk Find/replace text in file(s)
sed Stream editor for file transformations
source Execute commands from a file
env List or set environment variables
echo Display text on screen
read Read a line from standard input
export Set an environment variable
trap Run commands on signal
shasum Print/check SHA checksums

Compression and Archiving

Command Description
gzip Compress/decompress files
bzip2 Compress/decompress files
tar Archive files
zip Package and compress files
unzip Extract zip files
cpio Copy files to and from archives

Text Editors and Processing

Command Description
nano Simple text editor
vim Advanced text editor
sed Stream editor for transforming text
grep Search for patterns in text
awk Pattern scanning and processing language
tr Translate/squeeze/delete characters
wc Count words, lines, and characters in text
fmt Reformat paragraph text

Utility and Miscellaneous Tools

Command Description
cal Display a calendar
man Display help for commands
bc Arbitrary precision calculator
say Convert text to audible speech
time Measure program resource use
screen Terminal multiplexer
open Open files, folders, URLs, applications
osascript Execute AppleScript
pbcopy Copy text to the clipboard
pbpaste Paste text from the clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment