{macOS_commands} terminal commands for MacOS. a-z.
today we dive into the macOS terminal window and discover the available commands we can run. so grab your coffee, sit down in the commanders seat, open that terminal window annnnnnnnddddddd……………type:
{ a }
afconvert :// audio file convert
afinfo :// audio file info
afplay :// audio file play
airport :// manage apple airport
alias :// create an alias
alloc :// list used and free memory
apropos :// search the whatis database for strings
asr :// apple software restore
atsuil :// font registration system utility
awk :// find and replace text within file [s]
{ b }
basename :// convert a full pathname to just a filename
bash :// bourne-again SHell
bg :// send to background
bind :// set or display readline key and function bindings
bless :// set volume bootility and startup disk options
break :// exit from a For, While, Unitl or Select loop
builtin :// execute a shell builtin
bzip2 :// compress or decompress files
{ c }
caffeinatce :// prevent the system from sleeping
cal :// display a calendar
calendar :// reminder service
caller :// return the context of a subroutine call
cancel :// cancel print jobs
case :// conditionally perform a command
cat :// concatenate and print the content of files – [display file]
cd :// change directory
chflags :// change a file or folder’s flag
chgrp ://change group ownership
chmod ://change access permissions
chown ://change file owner and group
chroot ://run a command with a different root directory
cksum ://print CRC checksum and byte counts
clear ://clear terminal screen
cmp ://compare two files
comm :// compare two sorted files line by line
command :// run a command [not a function]
complete :// edit a command completion [word/pattern/list]
continue :// resume the next iteration of a loop
cp :// copy one or more files to another location
cron :// daemon to execute scheduled commands
crontab :// schedule a command to run at a later date/time
csplit :// split a file into context-determined pieces
csrutil :// configure System Integrity Protection [SIP]
cupsfilter :// convert a file to another format using cups filters
curl :// transfer data from or to a server
cut :// divide a file into several parts
{ d }
date :// display or change the date & time
dc :// desk calculator
dd :// data duplicator – convert and copy a file, clone disks
declare :// declare variable & set attributes
defaults :// set preferences, show hidden files
df :// display free disk space
diff :// display the differences between two files
diff3 :// show differences among three files
dig :// DNS lookup
dirname :// convert a full pathname to just a path
dirs :// display list of remembered directories
diskutil :// disk utilities – format, verify, repair
disown :// unbind a job from the current login session
ditto :// copy files and folders
dot_clean :// remove dot-underscore files
drutil :// interact with CD/DVD burners
dscacheutil :// query or flush the Directory Service/DNS cache
dseditgroup :// edit, create, manipulate, or delete groups
dsenableroot :// enable root access
dsmemberutil :// view user and groups rights
dscl :// Directory Service command line utility
dtruss :// print process system call time details
du :// estimate file space usage
{ e }
echo :// display text on screen
ed :// a line-oriented text editor [edlin]
enable :// enable and disable builtin shell commands
env :// list or set environment variables
eval :// evaluate several commands/arguments
exec :// execute a command
exit :// exit the shell
execsnoop :// snoop new process execution
expand :// convert tabs to spaces
expect :// programmed dialogue with interactive programs
{ f }
fc :// fix command [history]
fdisk :// partition table manipulator for Darwin UFS/HFS/DOS
fdesetup :// FileVault configuration, list FileVault users
fg :// send job to foreground
file :// determine file type
find :// search for files that meet a desired criteria
fmt :// reformat paragraph text
fold :// wrap text to fit a specified width
for :// loop command
fsck :// Filesystem consistency check and repair
fs_usage :// Filesystem usage [process/pathname]
ftp :// internet file transfer program
function :// define function Macros
fuser :// list processes that have one or more files open
{ g }
GetFileInfo :// get attributes of HFS+ files
getopt :// parse positional parameters
getopts :// parse positional parameters
goto :// jump to label and continue execution
grep :// search file[s] for lines that match a given pattern
groups :// print group names a user is in
gzip :// compress or decompress files
{ h }
halt :// stop and restart the operating system
hash :// refresh the cached/remembered location of commands
head :// display the first lines of a file
hdiutil :// manipulate iso disk images
history :// command history
hostname :// print or set system name
{ i }
iconv :// convert the character set of a file
id :// print user and group names/id’s
if :// conditionally perform a command
ifconfig :// configure network interface parameters
iostart :// report CPU and i/o statistics
ipconfig :// view and control IP configuration state
info :// help info
install :// copy files and set attributes
iosnoop :// snoop I/O events as they occur
{ j }
jobs :// list active jobs
join :// join lines on a common field
{ k }
kexktfind
kextstat
kextunload
kickstart
kill
killall
{ l }
l :// list files in long format [ls -l]
last :// indicate last logins of users and ttys
launchctl :// load or unload daemons/agents
ll :// list files in long format, showing invisible files [ls -la]
less :// display output one screen at a time
let :// evaluate expression
lipo :// convert a universal binary
ln :// make links between files [hard links, symbolic links]
local :// set a local [function] variable
locate :// find files
logname :// print current login name
login :// log into the computer
logout :// exit a login shell [bye]
look :// display lines beginning with a given string
lp :// print files
lpr :// print files
lprm :// remove jobs from the print queue
lpstart :// printer status information
ls :// list information about file[s]
lsregister :// reset the Launch Services database
lsbom :// list a bill of materials file
lsof :// list open files
{ m }
man :// help manual
mdfind :// spotlight search
mdutil :// manage Spotlight metadata store
mkdir :// create new folder[s]
mkfifo :// make FIFOs [named pipes]
mkfile :// make a file
mktemp :// make a temporary file
more :// display output one screen at a time
mv :// move or rename files or directories
{ n }
nano :// simple text editor
nc/netcat :// read and write data across networks
net :// manage network resources
networksetup :// Network and System Preferences
nice :// set the priority of a command
nohup :// run a command immune to hangups
ntfs.util :// NTFS file system utility
nvram :// manipulate firmware variables
{ o }
onintr :// control the action of a shell interrupt
open :// open a file/folder/URL/Application
opensnoop :// snoop file opens as they occur
openssl :// OpenSSL command line
osacompile :// compile Applescript
osascript :// execute AppleScript
{ p }
passwd :// modify a user password
paste :// merge lines of files
pbcopy :// copy data to the clipboard
pbpaste :// paste data from the Clipboard
pgrep :// list processes by a full or partial name
ping :// test a network connection
pkill :// kill processes by a full or partial name
pkgbuild :// build a macOS Installer component package
pkgutil :// query and manipulate installed packages
plutil :// property list utility
pmset :// Power Management settings
popd :// restore the previous value of the current directory
pr :// convert text files for printing
printenv :// list environment variables
printf :// format and print data
ps :// process status
pushd :// save and then change the current directory
pwd :// print Working Directory
{ q }
qlmanage :// Quick Look Server debug and management tool
quota :// display disk usage and limits
{ r }
rcp :// copy files between machines
read :// read one line from standard input
readonly :// mark a variable or function as read-only
reboot :// stop and restart the system
ReportCrash :// enable/disable crash reporting
return :// exit a function
rev :// reverse lines of a file
rm :// remove files
rmdir :// remove folder[s]
rpm :// Remote Package Manager
rsync :// remote file copy – sync file tree
{ s }
say :// convert text to audible speech
screen :// multiplex terminal, run remote shells via ssh
screencapture :// capture screen image to file or disk
scselect :// switch between network locations
scutil :// manage system configuration parameters
sdiff :// merge two files interactively
security :// Administer Keychains, keys, certificates & Security framework
sed :// Stream Editor
select :// generate a list of items
serverinfo :// server information
set :// set a shell variable = value
setfile :// set attributes of HFS + files
sharing :// create share points for afp, ftp and smb services
shasum :// print or Check SHA Checksums
shift :// shift positional parameters
shopt :// set shell options
shutdown :// shutdown or restart macOS
sips :// scriptable image processing system
sleep :// delay for a specified time
softwareupdate :// system software update tool
sort :// sort text files
source :// execute commands from a file
spctl :// security assessment policy/gatekeeper
split :// split a file into fixed-size pieces
sqlite3 :// SQL database [download history]
srm :// securely remove files or directories
stat :// display the status of a file
stop :// stop a job or process
su :// substitute user identity
sudo :// execute a command as another user
sum :// print a checksum for a file
suspend :// suspend execution of this shell
sw_vers :// print macOS operating system version
sysctl :// get or set kernel state
system_profiler :// report system configuration
systemsetup :// computer and display system settings
{ t }
tail :// output the last part of files
tar :// tape ARchiver
tccutil :// manage the privacy database
tcpdump :// dump traffic on a network
tee :// redirect output to multiple files
test :// condition evaluation
textutil :// manipulate text files in various formats [doc,html,rtf]
top :// display process information
touch :// change file timestamps
tput :// set terminal-dependent capabilities, color & position
tr :// translate, squeeze, and/or delete characters
trap :// execute a command when the shell receives a signal
traceroute ://Trace Route to Host
trimforce :// enable TRIM commands on third-party drives
tty :// print filename of terminal on stdin
type :// describe a command
{ u }
ufs.util :// mount/unmount UFS file system
umask :// users file creation mask
unmount :// unmount a device
unalias :// remove an alias
uname :// print the Darwin OS Kernel version/release/machine name
unexpand :// convert spaces to tabs
uniq :// uniquify files
units :// convert units from one scale to another
unset :// remove variable or function names
until :// loop command
uptime :// show how long system has been running
users :// print login names of users currently logged in
until :// execute commands [until error]
uuencode :// encode a binary file
uudecode :// decode a file created by uuencode
uuidgen :// generate a Unique ID [UUID/GUID]
uucp :// Unix to Unix copy
{ v }
vi :// Text Editor
{ w }
w :// show who is logged on and what they are doing
wait :// wait for a process to complete
wall :// write a message to users
wc :// print byte, word, and line counts
whatis :// search the whatis database for complete words
whereis :// locate a program
which :// locate a program file in the user’s path
while :// loop command
who :// print all usernames currently logged on
whoami :// print the current user id and name [‘id -un’]
write :// send a message to another user
{ x }
xargs :// execute utility – passing arguments
xattr :// display and manipulate extended attributes
xcode-select — install :// install the command line developer tools
{ y }
yes :// print a string until interrupted
{ z }
zip :// package and compress [archive] files.
!! :// run the last command again
happy to add more to the collection if there is anything missed! cheers.
reference > operator handbook [netmux]