macOS - All Commands Cheat Sheet

macOS - All Commands Cheat Sheet

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

A

afconvert afconvert (Audio File Convert) is a command-line utility in macOS used for converting audio files between different formats.
afinfo afinfo (Audio File Info) is a command-line utility on macOS that provides detailed information about audio files.
afplay afplay is a command-line utility on macOS used to play audio files from the terminal.
airport The airport command on macOS is used to interact with the wireless networking functionalities of your Mac.
alias The alias command in macOS is used to create shortcuts or new names for commands or command sequences.
apropos The apropos command in macOS is a useful tool for searching the man pages for entries that contain a given keyword.
asr The asr (Apple Software Restore) command in macOS is used for cloning volumes, restoring disk images to volumes, and other disk copying tasks.
awk awk is a versatile programming language and command-line tool primarily used for pattern scanning and processing.

B

basename basename is a command-line utility in macOS that strips directory and suffix from a given file path.
bash bash, the Bourne-Again SHell, is a command interpreter that allows users to type commands directly to the system.
bash bang The !! command in macOS provides a quick and convenient way to repeat the last executed command in the Terminal.
bc bc (Basic Calculator) is a command-line calculator included in macOS that supports arbitrary precision arithmetic.
bg The bg command in macOS resumes suspended jobs in the background, allowing them to continue running without occupying the terminal directly.
bind The bind command in macOS is used primarily within shell environments to associate or bind keyboard sequences with shell functions, or to reconfigure the behavior of the keyboard in interactive shell environments.
bless The bless command on macOS is used primarily to set the boot volume and to initiate a system reboot into macOS recovery, another partition, or network boot.
break The break command in macOS is used primarily within scripting environments such as shell scripts.
brew Homebrew, commonly referred to as brew, is a free and open-source package management system specifically designed for macOS to simplify the installation of software.
builtin The builtin command in macOS is used to run a shell builtin, suppressing functionality of shell functions by the same name.
bzip2 bzip2 is a command-line based file compression tool similar to gzip, but utilizing the Burrows-Wheeler block sorting text compression algorithm along with Huffman coding.

C

caffeinate The caffeinate command in macOS is used to prevent the system from sleeping.
cal The cal command in macOS displays a calendar in the terminal, showing a simple visual representation of months and years according to the Gregorian calendar.
calendar The calendar command in macOS is used to display information about upcoming events and reminders by scanning a special calendar file.
caller The caller command in macOS is utilized predominantly in scripting and programming contexts to return the context of any active subroutine call (a frame).
cancel The cancel command in macOS is used to cancel existing print jobs on a system.
case The case command in macOS is a shell builtin that performs conditional matching against strings.
cat The cat command in macOS is a utility used to read, concatenate, and write files to the standard output.
cd The cd (Change Directory) command in macOS is used to change the current working directory in the terminal or command line interface.
chflags The chflags command in macOS is used to change the file flags on filesystem objects.
chgrp The chgrp command in macOS is used to change the group ownership of one or more files or directories.
chmod chmod (change mode) is a command used on macOS to change the permissions of files or directories.
chown chown (change owner) is a command line utility in macOS that allows users to change the owner and/or group ownership of files and directories.
chroot chroot is a command on macOS that changes the effective root directory for the current running process and its children.
chsh The chsh command on macOS is used to change a user's login shell.
cksum The cksum command in macOS calculates and displays the CRC (Cyclic Redundancy Check) checksum and byte size of a file.
cmp The cmp command in macOS is a utility mainly used for comparing two files byte by byte.
codesign codesign is a command-line utility used on macOS systems for creating, checking, and displaying code signatures, as well as for verifying the integrity of signed apps and bundles.
comm The comm command in macOS is used to compare two sorted files line by line.
command The command utility in macOS is used to run a specified command while ignoring shell functions or aliases that might override it.
complete The complete command in macOS is used primarily within shell environments to manage tab-completion settings for other commands.
continue The continue command in macOS is used within looping constructs in shell scripts.
cp The cp command in macOS is used for copying files and directories from one location to another.
cpio cpio is a command-line tool used on macOS for managing archives of files.
createhomedir The createhomedir command in macOS is used to create home directories for local and network user accounts.
cron cron is a time-based job scheduler in Unix-like operating systems including macOS.
crontab The crontab command in macOS is used for managing cron jobs, which are scheduled tasks that run at specified intervals.
csplit The csplit command in macOS is used to split files into sections determined by context lines.
csrutil The csrutil command in macOS, short for "System Integrity Protection Configuration," is a critical tool designed for managing the System Integrity Protection (SIP) setting on macOS.
cupsfilter cupsfilter is a command utilized on macOS to convert a file from one format to another using CUPS (Common UNIX Printing System) filters.
curl curl is a powerful command-line tool used to transfer data to or from a server using various protocols such as HTTP, HTTPS, FTP, FTPS, SCP, SFTP, and more.
cut The cut command in macOS is a text processing tool primarily used to extract sections from each line of input files.

D

date The date command in macOS is used to display or set the system date and time.
dc The dc (desk calculator) command is a reverse Polish notation (RPN) calculator that operates on arbitrary precision numbers.
dd The dd command in macOS is a versatile utility primarily used for low-level copying and conversion of raw data.
declare The declare command, primarily found in Unix-like operating systems with Bash shells, is used to declare shell variables and assign attributes to them.
defaults The defaults command in macOS is used for interacting with the defaults system, which manages user preferences.
df The df command (short for "disk free") is used to display the amount of available disk space for file systems on which the current user can perform operations.
diff The diff command is used on macOS to compare files and directories line by line, highlighting differences between them.
diff3 diff3 is a command-line utility used in macOS for comparing three files line by line.
dig The dig command (Domain Information Groper) is a versatile tool for querying DNS (Domain Name System) servers.
dirname The dirname command in macOS is used to strip the last component from a file path, effectively returning the directory component.
dirs The dirs command in macOS is used to display the list of currently remembered directories in the directory stack.
diskutil diskutil is a command-line utility on macOS used for managing disk drives and volumes.
disown The disown command in macOS is used to remove jobs from the current shell's active job list, thereby preventing the shell from sending a HUP (hangup) signal to them when the shell exits.
ditto The ditto command in macOS is a versatile utility used for copying files and directories while preserving filesystem metadata and attributes.
dot_clean The dot_clean command on macOS merges ._* files (AppleDouble format used on macOS to store additional metadata about a file) with their corresponding native files.
drutil drutil is a command-line utility used on macOS systems for interacting with optical drives.
dscacheutil The dscacheutil command in macOS is used for querying and managing the Directory Service cache.
dscl dscl (Directory Service command line utility) is a command-line tool used on macOS for managing and querying Directory Services.
dseditgroup The dseditgroup command is a utility in macOS used for creating, editing, and deleting groups in the Directory Services (DS) store.
dsenableroot dsenableroot is a command-line utility in macOS that facilitates the enabling or disabling of the root user account.
du The du (disk usage) command in macOS is used to estimate and report the file space usage of a given set of files or directories.

E

echo The echo command in macOS is used for displaying lines of text or string variables.
enable The enable command in macOS is used to activate or deactivate shell built-ins or functions temporarily within a terminal session.
env The env command on macOS is used to run a program in a modified environment.
eval The eval command in macOS is used to execute arguments as a single command in the shell's context.
exec The exec command in macOS is used to replace the current shell process with a new process specified by the user.
execsnoop execsnoop is a diagnostic command-line tool available on macOS that monitors and logs process execution in real time.
exit The exit command in macOS is used to terminate a shell session, exit from a script, or close a terminal window.
expand The expand command in macOS is used to convert tabs in each file to spaces, writing to standard output.
export The export command in macOS is used to set or export environment variables and functions to the environment of subsequently executed commands.
expr The expr command in macOS is a utility for evaluating expressions.

F

false The false command in macOS is a simple utility used in shell scripting and programming to return an exit status of 1.
fc The fc command in macOS is used for listing, editing, and re-executing commands from the command history.
fdisk fdisk is a command-line utility used on macOS for disk partitioning.
fg The fg command in macOS is used to bring a job to the foreground from the background.
file The file command in macOS identifies file types.
find The find command in macOS is a powerful utility used to search and locate the list of files and directories based on conditions you specify.
fmt The fmt command in macOS is a text utility used to reformat paragraph text to a specified width, optimizing readability.
fold The fold command in macOS is used to wrap each input line to fit a specified width.
for The for command in macOS is used for iterating over a series of values in a shell script.
fsck fsck (File System Consistency Check) is a command-line utility in macOS used to check and optionally repair file system issues.
fs_usage fs_usage is a monitoring tool specific to macOS that reports on file system activity in real-time.
ftp The ftp command in macOS is used to transfer files between a client and a server using the File Transfer Protocol (FTP).
function The function command in macOS is used to define functions in the shell environment, primarily in bash and zsh.
fuser The fuser command in macOS identifies the processes using files or sockets.

G

GetFileInfo GetFileInfo is a command-line utility in macOS used to display the metadata attributes of files and directories within the file system.
getopt The getopt command in macOS is used for parsing command-line options.
getopts getopts is a command used in shell scripts to parse positional parameters and options.
goto The goto command on macOS is a scripting utility used to facilitate conditional or unconditional navigation within scripts.
grep grep (global regular expression print) is a powerful command-line utility in macOS used for searching plain-text data sets for lines that match a regular expression.
groups The groups command in macOS displays the group memberships for the specified user, or if no user is specified, for the current user.
gzip gzip (GNU zip) is a command-line utility used on macOS and other Unix/Linux-based systems for file compression and decompression.

H

halt The halt command in macOS is used to stop all CPU functions in a safe manner, essentially bringing the system to a halt.
hash The hash command in macOS is used primarily to handle command hashing.
hdiutil hdiutil is a command-line utility on macOS that manages disk images.
head The head command in macOS is used to display the first few lines of text files to the standard output.
history The history command in macOS displays the list of commands that have been previously entered by the user in the current terminal session.
hostname The hostname command in macOS is used to display or set the system's host name.

I

iconv iconv is a command-line utility in macOS used to convert the character encoding of text from one format to another.
id The id command in macOS is used to display the user identity and group information for a user.
if The if command in macOS is a conditional shell command used in shell scripting to perform conditional execution of commands.
ifconfig The ifconfig command, short for "interface configuration," is a traditional Unix-based utility used to configure network interfaces in UNIX and UNIX-like operating systems, including macOS.
info The info command on macOS provides a means to view the Info documentation files.
install The install command on macOS is used to copy files and set attributes such as ownership, permissions, and directory mode.
installer The installer command in macOS is used to install and manage software packages.
iosnoop iosnoop is a command-line utility used on macOS to monitor disk I/O activity in real time.
iostat iostat is a command-line utility used in macOS to monitor system input/output device loading by observing the time the devices are active relative to their average transfer rates.
ipconfig The ipconfig command in macOS is used to configure and display network interface parameters.

J

jobs The jobs command in macOS is used to list the status of jobs in the current terminal session.
join The join command on macOS is used to combine the lines of two sorted text files based on a common field.

K

kextfind The kextfind command in macOS is a utility designed to search for kernel extensions (kexts) based on specific attributes, property values, and dependencies.
kextstat The kextstat command in macOS is used to display status information about kernel extensions (kexts).
kextunload kextunload is a command-line utility used on macOS to unload kernel extensions (kexts).
kickstart The kickstart command on macOS is used to enable, disable, and manage Apple Remote Desktop (ARD), a technology allowing remote management of macOS systems.
kill The kill command in macOS is used to send signals to running processes, typically for terminating processes.
killall The killall command in macOS is used to terminate all processes that match the name specified.
klist The klist command in macOS is used for listing the current Kerberos tickets held in a user's credential cache.

L

l The l command in macOS is an alias typically used to provide a formatted listing of directory contents, integrating options that augment the output with detailed information.
last The last command in macOS is used to display a list of all the users who have logged in (and out) on the system, as specified in the system's log files.
launchctl The launchctl command in macOS is a powerful tool used for managing launchd, a system and session manager that operates at the back-end of macOS.
leave The leave command allows you to gracefully leave a remote session you've connected to via a service like SSH.
less less is a command-line tool for viewing and navigating text files, such as log files, source code, and configuration files.
let The let command in macOS is a powerful tool for assigning values to variables, modifying existing values, and performing basic arithmetic operations.
lipo lipo (short for "library compatibility") is a command-line tool used on macOS and other Unix-like operating systems to combine multiple architecture-specific binary files into a single universal binary file.
ll The ll command in macOS is an alias typically used to list directory contents in a formatted and detailed manner.
ln ln is a versatile macOS command used to create symbolic or hard links between files and directories.
local The local command in macOS is a powerful tool for managing local configuration files.
locate locate is a powerful command-line utility in macOS designed to quickly search for files within the system's indexed database.
login The login command provides a secure login interface for users to access the macOS system.
logname The logname command in macOS is a simple yet useful tool that displays the current user's login name.
logout The logout command allows you to end your current macOS user session and return to the login window.
look The look command searches for a specific pattern within a given file or a list of files.
lp The lp command in macOS is used for sending print jobs to a designated printer or a queue of print jobs.
lpr lpr is a macOS command used to submit print jobs to a printer.
lprm lprm is a macOS command used for removing print jobs from the print queue on a system.
lpstat lpstat is a macOS command-line utility that provides information about print jobs, printers, and the print queue.
ls The ls command is a fundamental tool for navigating the macOS file system.
lsbom The lsbom command is a powerful tool used to inspect and analyze the contents of binary executables on macOS.

M

md5 The md5 command calculates and prints the MD5 checksum (a 128-bit hexadecimal number) for a file, text, or standard input data.
mdfind mdfind is a powerful command-line tool on macOS used to perform rapid and comprehensive file searches across an entire file system or specified directories.
mdimport mdimport is a command-line tool for importing email messages, contacts, calendars, and other data from a variety of sources into Apple Mail and Contacts.
mdls mdls (macOS Dictionary Lookup Service) is a command-line tool that provides detailed information about files, including their metadata, attributes, and technical details.
mdutil
mkfifo The mkfifo command creates a named pipe (FIFO) in the specified location.
mkfile mkfile is a macOS command used to create a new file with specified content.
mktemp mktemp creates a temporary file or directory.
more more is a command-line utility in macOS that allows you to view the contents of a file or input stream one page at a time.
mount The mount command in macOS allows users to connect a file system, such as a hard drive, optical disc, or network share, to the system so that it can be accessed and managed.
mv

N

nano Nano is a text editor designed for the command line with an intuitive and user-friendly interface.
nc netcat nc-netcat is a command-line utility for establishing network connections with various protocols and performing various network operations.
net macOS's net command offers a versatile suite of tools for configuring, managing, and troubleshooting network settings.
networkQuality networkQuality measures the quality of the active internet connection on a device running macOS.
networksetup networksetup is a macOS command-line tool for managing network settings and configurations.
nice The nice command in macOS allows users to adjust the priority of a command or process, influencing how quickly the system allocates resources to it.
nl nl (number lines) adds line numbers to a text file.
nohup nohup allows you to run commands without having to keep the terminal window open.
ntfs.util ntfs.util is a command-line tool specifically engineered for macOS to manipulate and manage NTFS file systems.
nvram

O

onintr onintr allows users to specify the action the system should take when a user presses Ctrl+C.
open The open command is a powerful tool for interacting with files, folders, and applications on macOS.
opensnoop opensnoop is a powerful utility that continuously monitors file and directory openings within a specified scope.
osacompile osacompile is a macOS command-line tool used to compile AppleScript scripts and create standalone applications or script bundles.
osascript osascript is a macOS command-line tool for automating tasks via AppleScript.

P

passwd Ensure that you have proper permissions to change the specified user's password.
paste paste is a versatile command-line utility that allows you to manipulate and paste text content on macOS.
pbcopy pbcopy is a command-line utility used to copy text to the macOS clipboard.
pbpaste pbpaste is a command-line utility for retrieving the contents of the macOS pasteboard.
pbs pbs is a command-line utility that allows you to interact with the macOS clipboard, enabling you to set, get, and manipulate its contents.
ping
pkgutil pkgutil is a command-line tool for managing packages on macOS.
pmset pmset is a macOS command-line tool for managing power settings on Mac computers.
popd popd is a macOS shell command that allows you to quickly navigate back to the directory you were previously in.
pr The pr command in macOS is used for pagination and setup of text files for printing.
printenv printenv is a macOS command that displays all environment variables and their values.
printf printf is a versatile command-line tool in macOS for formatted output.
profiles profiles is a macOS command that configures and manages system profiles, providing functionality to create, delete, activate, and view profiles in system preferences.
pushd pushd is a versatile command-line tool used to manipulate the working directory stack within the Terminal.

Q

qlmanage qlmanage is a versatile command-line tool in macOS for managing and manipulating various types of files and data.
quota The quota command in macOS provides the current and maximum disk usage quotas for the current user.

R

rcp rcp (remote copy) is a command-line utility for copying files between local and remote hosts.
read read reads a line from the standard input and stores it in a shell variable.
readonly readonly is a macOS command that allows you to make a file or directory read-only, preventing any modifications or deletions.
ReportCrash ReportCrash is a utility that collects system information and diagnostic data after a crash or hang occurs on macOS.
rev rev reverses the lines of a file, or standard input if no file is specified.
rm rm is a fundamental command in macOS used to delete files or directories from the filesystem.
rmdir rmdir is a command-line utility used to remove empty directories in macOS.
rsync rsync is a UNIX-like command designed for efficiently transferring and synchronizing files between two locations, even over remote networks.

S

say say is a versatile command-line tool that converts text into synthesized speech.
screen screen is a terminal multiplexer that manages multiple text sessions within a single physical terminal.
screencapture The macOS command screencapture is a powerful tool for capturing screenshots and screen recordings on your Mac.
scselect scselect manages and manipulates Screen Capture (screencast or screen recording) settings in macOS.
scutil scutil is a macOS command-line tool used for configuring and managing network-related settings on Apple devices running macOS, iOS, and iPadOS.
sdiff sdiff is a command-line tool used to create a side-by-side visual comparison of two files, highlighting the differences between them.
security The security command is a powerful tool for managing security settings and credentials on macOS.
sed sed is a powerful stream editor that performs text transformations on an input stream.
select select is a command-line tool for interactive text selection and processing in macOS.
seq This error occurs when the specified increment or end value is not a valid number.
serverinfo The serverinfo utility gathers and displays comprehensive system information for macOS devices.
set The set command in macOS is a versatile tool for managing shell variables and settings.
setfile setfile is a versatile macOS command-line tool that allows users to modify file attributes and metadata.
sharing The sharing command in macOS allows users to manage file and screen sharing settings, configure permissions, and control discoverability on the local network.
shasum shasum computes and outputs the SHA hash (Secure Hash Algorithm) for a file or string.
shift Shift is a macOS command-line utility that allows you to move or rename files in bulk by providing intuitive syntax.
shopt shopt is a versatile macOS command that allows users to customize and configure shell options.
shortcuts shortcuts is a command-line tool for managing and launching Automator workflows and AppleScripts.
sips sips is a versatile command-line tool designed exclusively for macOS that enables users to perform a wide range of image processing tasks.
sleep The sleep command in macOS is a versatile tool that suspends or delays script execution for a specified duration.
softwareupdate The softwareupdate command allows users to check for, install, and manage software updates for macOS.
sort sort is a versatile command-line utility for sorting text files or input data.
source source is a shell command used to execute commands from a file within the current shell environment.
split split divides a file into several smaller files.
sqlite3 sqlite3 is a command-line tool used to manage and interact with SQLite databases on macOS.
srm srm is a command used on macOS to securely remove files by overwriting their contents multiple times, making it difficult to recover the data using common data recovery tools.
stat The stat command provides detailed information about files and directories.
sum The sum command calculates the sum of values specified via standard input or arguments.
suspend The suspend command in macOS allows you to put your Mac into a low-power sleep state, preserving its current state and consuming minimal power.
sw_vers The sw_vers command provides detailed information about the macOS operating system running on a computer.
sysctl sysctl is a command-line utility for viewing and modifying system parameters in macOS.
systemsetup The systemsetup command is a versatile tool used to manage various system settings and configurations on macOS.
system_profiler system_profiler is a macOS command-line tool that provides detailed information about your system's hardware, software, and network configuration.

T

tab2space tab2space is a versatile macOS command that enables the conversion of tab characters into space characters.
tabs Missing file or directory: If the path specified with the -o option doesn't exist, you will get an error.
tail tail displays the last part of one or more files.
tar tar is a powerful command-line utility on macOS used for creating, modifying, and extracting archive files.
taskpolicy taskpolicy is a command-line utility for managing macOS system task policies.
tccutil tccutil is a versatile command-line tool tailored specifically for managing application access to user data and privacy-sensitive resources on macOS.
tcpdump tcpdump is a command-line tool that captures and analyzes network traffic on macOS systems.
tee tee is a command-line utility in macOS that reads input from standard input and writes it to both standard output and one or more specified files.
test test is a command-line utility for evaluating expressions and performing conditional execution in shell scripts.
textutil The textutil command in macOS is a versatile tool that enables users to manipulate and transform text content in various ways.
time The time command executes a specified command or script and reports the time it takes to complete.
times The times command in macOS allows users to execute a specified command multiple times, with a specified delay between each execution.
tmutil tmutil is an essential Time Machine administration tool used to manage local snapshots and interact with Time Machine backups.
top top provides a real-time view of system processes, their resource consumption, and performance metrics.
touch touch is a command-line tool that creates or updates a file's timestamp, but does not modify the file's contents.
tput tput is a versatile terminal control program that manipulates the appearance and attributes of characters on a terminal screen.
tr tr is a versatile text processing tool for character-based transformations.
traceroute The traceroute command traces the route taken by packets from the local host to a specified destination.
traceroute6 traceroute6 is a powerful command-line tool for diagnosing network connectivity and latency over IPv6 networks.
trimforce trimforce forces the file system to trim a given file or volume.
true The true command in macOS is a simple utility that always returns a zero exit code, indicating success.
tty The tty command identifies the file associated with the standard input of the current shell and displays its device name.
type

U

ulimit ulimit is a command-line utility used to control the resource limits for processes on macOS.
umask umask is a macOS command used to set or display the file mode creation mask.
umount The umount command in macOS detaches a mounted volume from the file system, making it unavailable to the system.
unalias unalias removes aliases from the current shell environment.
uname uname displays basic information about the current system, including the operating system name and version, kernel version, computer hardware name, and processor type.
unexpand unexpand is a utility that removes leading whitespace and tabs from the text files.
uniq uniq is a versatile command for removing or counting duplicate lines in a file, enhancing data quality and simplifying text processing tasks.
units -a, --angle: Convert angles between degrees, radians, and gradians.
unset The unset command unsets a shell variable, removing its value from the current shell environment.
until The until command is a powerful tool that repeatedly executes a command or set of commands until a specified condition is met or a specified number of iterations has been reached.
uptime The uptime command provides information about the uptime of the macOS system.
users The users command in macOS provides a quick way to view active users currently logged into the system.
uudecode
uuencode uuencode converts binary files into a text representation using the uuencoding scheme, allowing them to be transmitted through channels that only support text.
uuidgen uuidgen is a macOS command-line tool that generates universally unique identifiers (UUIDs).

V

vi vi is a powerful text editor available in macOS, designed for efficient text manipulation and code editing.

W

w The **w** command displays information about current system users and their processes.
wall wall sends a message to all users who are currently logged in.
wc wc (word count) is a command-line utility that counts and displays the number of lines, words, and bytes contained within a given file or input stream.
whatis whatis is a macOS command-line utility that provides a concise description of a given macOS command, utility, or feature.
whereis whereis is a command-line tool used to locate the binary, source, or man page of a specified program or command.
which The which command can be used in conjunction with other macOS commands to perform advanced tasks.
while while is a command-line utility that executes a set of commands repeatedly until a condition is met.
who
write The write command is an essential macOS tool for sending brief messages to other users on your local network.

X

xargs xargs is a powerful command-line utility that constructs and executes command-lines from standard input.
xattr xattr manages extended attributes associated with files and directories on macOS.
xcode select The xcode-select command allows developers to manage the active version of Xcode and the active SDK in the command line interface.
xxd xxd transforms binary files into a human-readable format by displaying the raw data in hexadecimal and ASCII character representation.

Y

yes yes infinitely outputs a single word or phrase to stdout, primarily used for confirming prompts or supplying continuous input.

Z

zip zip is a macOS command that compresses files and directories into ZIP archives.