- Commands For Terminal On Mac
- Mac Terminal Commands Cheat Sheet Pdf
- Mac Terminal Commands Pdf
- List Of Commands For Terminal On Mac
- Commands For Terminal On Mac
Terminal (officially called Terminal.app) is, strictly speaking, an emulator and works off most typical UNIX commands (OS X is a UNIX-based system, as opposed to Windows, which is NT-based). Unlike OS X, which has a graphical user interface (shortened to GUI), Terminal works off a text-based interface and all commands have to be typed in - this. An A-Z Index of the Apple macOS command line (macOS bash) 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 atsutil Font registration system utility automator Run an Automator workflow awk Find and Replace text. Mac Terminal Commands – Complete List This is a complete A- Z index of all Mac commands and the terminal events associated with those commands. We have compiled this list by using official sources and have explained more clearly and elaborately about each of them.
This is a complete A- Z index of all Mac commands and the terminal events associated with those commands. We have compiled this list by using official sources and have explained more clearly and elaborately about each of them. We have also added two additional columns specifying whether or not the command is an inbuilt system one. The final column also displays the Mac version support for each of these commands.
IMPORTANT: If you are not an advanced user and have no knowledge on how to use the terminal commands, please do not try to experiment. These are meant for medium and advanced users ONLY.
Mac Terminal Commands – A to Z
Command | InBuilt | Command Action and Event | All |
alias | Yes | Creation of a Alias for current User | Yes |
alloc | No | Free Memory is Listed | Yes |
apropos | No | String search in What is database | NA |
awk | No | Scan and overwrite Text inside file and files | NA |
basename | No | Change full path name to path name | NA |
bash | No | Bourne-Again Shell | NA |
bg | Yes | Send to background | Yes |
bind | Yes | Read line Key is displayed | Yes |
bless | No | Assign Boot and start-up options | NA |
break | Yes | Exit a redundant loop | Yes |
builtin | Yes | Execute a built in shell command | Yes |
bzip2 | No | Compress and decompress a file | Yes |
cal | No | The calendar is displayed | Yes |
caller | Yes | Subroutine call context is returned | Yes |
case | Yes | Conditional statement | Yes |
cat | No | Append and Display file content | Yes |
cd | Yes | Change current Directory | Yes |
chflags | No | Change flags | NA |
chgrp | No | Modify Group Ownership | NA |
chmod | No | Change group permissions | NA |
chown | No | Modify File owner and permissions | NA |
chroot | No | Execute a command using another root directory | NA |
cksum | No | Print and display checksum | NA |
clear | No | Clear current terminal screen contents | NA |
cmp | No | Simply compares two files | NA |
comm | No | Line by line comparison of two sorted lines | Yes |
command | Yes | Run or Execute a command | Yes |
complete | Yes | Edit or modify completion of a command | Yes |
continue | Yes | Resume a loop | Yes |
cp | No | Copy Command | NA |
cron | No | Run or Execute a prescheduled command | NA |
crontab | No | Schedule command for execution after an assigned time | NA |
csplit | No | Split a file into context-determined pieces | NA |
curl | No | Upload or download data from a server | NA |
cut | No | Cut a file into parts | Yes |
date | No | Display or modify date time | Yes |
dc | No | Display Desk Calculator | NA |
dd | No | (Copy a file) Data Dump | NA |
declare | Yes | Declare and assign attributes for a variable | Yes |
defaults | No | Set visual preference options for hidden files | NA |
df | No | Show unused disk space | Yes |
diff | No | Show difference between two files | Yes |
diff3 | No | Show difference between three files | NA |
dig | No | Command to lookup DNS details | NA |
dirname | No | Convert full path name to path | NA |
dirs | Yes | Display cached directories | Yes |
diskutil | No | Disk utility command | Yes |
disown | Yes | Remove a job from current session | Yes |
ditto | No | Same as copy command | Yes |
dot_clean | No | Remove dots and underscores from a context files | NA |
drutil | No | Disk drive utility command | NA |
dscacheutil | No | Flush DNS or cache | NA |
dscl | No | Command-line utility for directory service | Yes |
dseditgroup | No | Manage groups and users | Yes |
dsenableroor | No | Command to enable root access for a terminal | NA |
dsmemberutil | No | Show groups and users rights | NA |
du | No | File space usage estimation | NA |
echo | Yes | Display an entered message on the screen | Yes |
ed | No | A text editor program | Yes |
enable | Yes | Enable or disable system shell commands | Yes |
env | No | Display or Modify environment variables | Yes |
eval | Yes | Evaluate one or more commands or arguments | Yes |
exec | Yes | Execute command | Yes |
exit | Yes | Exit shell | Yes |
expand | No | Expand a Tab | NA |
expect | No | Pre assigned dialogue exchange for interactive programs | NA |
export | Yes | Assign environment variable | Yes |
expr | No | Evaluate an expression or set of expressions | Yes |
fc | No | Fix command | NA |
fdisk | No | Format disk command | NA |
fg | Yes | Bring a job to front | Yes |
file | No | Analyse file type | Yes |
find | No | File search matching requested criteria | NA |
fmt | No | Reformat Text in a paragraph | NA |
fold | No | Wrap text to automatically adjust with working area | NA |
for | Yes | Simple Loop command | Yes |
fs_usage | No | File system display usage | Yes |
fsactl | No | Enable or disable ACL support for File System | NA |
fsck | No | Check and repair file systems | NA |
ftp | No | FTP manager | NA |
getfileinfo | No | Get file attributes | Yes |
getopts | Yes | Parse the positional parameters | Yes |
goto | No | Jump to an assigned point and then continue program execution | NA |
grep | No | Search file with a certain pattern | NA |
groups | No | Display a user’s group name | NA |
gzip | No | Compress and decompress a file | Yes |
halt | No | Shutdown and Restart the system | NA |
hash | Yes | Refresh command cache and path names | Yes |
hdiutil | No | Hard drive interface Utility Tool | Yes |
head | No | Print first line from a text file | Yes |
history | Yes | History Command | Yes |
hostname | No | Display or modify System name | NA |
iconv | No | Convert character set of file(s) | NA |
id | No | Display user and group IDs | Yes |
if | Yes | Conditional Command statement | Yes |
info | No | Display help information | NA |
install | No | Copy and assign attributes of a file | Yes |
ipconfig | No | Configure network attributes and assign values | NA |
jobs | Yes | List all currently active jobs | Yes |
join | No | Join command | NA |
kextfind | No | List the kernel extension | NA |
kickstart | No | Configure and set Apple Remote Desktop properties | NA |
kill | No | Terminate a process directly | Yes |
l | No | List file in original long format | NA |
last | No | Indicate last login information of a users and additional info | NA |
launchctl | No | Launch daemons or agents | NA |
less | No | Display output on screen accommodating data per window | NA |
let | Yes | Evaluate an expression or set of expressions | Yes |
lipo | No | Convert binary format | Yes |
ll | No | List file in original long format, also display hidden files | Yes |
ln | No | Interlink files | NA |
local | Yes | Assign local variable | Yes |
locate | No | Find a file or files | Yes |
login | No | log-in your system | NA |
logname | No | Display current users login name | NA |
logout | Yes | Exit login shell | Yes |
lpr | No | Print file or files | Yes |
lprm | No | Remove queued print jobs | Yes |
lpstat | No | Printer info and current status | Yes |
ls | No | List a file information | NA |
lsof | No | List currently opened files | NA |
lsregister | No | Reset Launch Service database | NA |
man | No | Display Help manual | Yes |
mdfind | No | Spotlight search command | Yes |
mdutil | No | Spotlight search command utility | Yes |
mkdir | No | Create new directory | Yes |
mkfifo | No | Build FIFOs | Yes |
more | No | Display output data one screen at one time | NA |
mount | No | Mount a file system | NA |
mv | No | Cut or rename directories or files | NA |
nano | No | Bring up text editor | Yes |
net | No | Configure network resources | NA |
netstat | No | Display network information | NA |
networksetup | No | Assign network attributes | Yes |
nice | No | Set command priority | NA |
nohup | No | Hang-up a command | NA |
ntfs.util | No | NTFS utility command | Yes |
onintr | No | Control shell action | NA |
open | No | Open up a file or location | NA |
osacomplie | No | Command to Compile an Apple script | NA |
osasdript | No | Execute an AppleScript | NA |
passwd | No | Modify user password directly | Yes |
paste | No | Merge lines from two or more files | Yes |
pbcopy | No | Copy the data to clipboard | NA |
pbpaste | No | Paste the data from Clipboard | NA |
ping | No | Check a network connection | NA |
pkgutil | No | Display or change Installed packages info | NA |
plutil | No | Property list command utility | Yes |
pmset | No | Configure Power Management settings | Yes |
popd | Yes | Restore previous value of current directory | Yes |
pr | No | Modify Text files to print | Yes |
printenv | No | Display all environment variables | Yes |
printf | Yes | Print command | Yes |
ps | No | Display Process status | Yes |
pushd | No | Save and change current directory | NA |
pwd | Yes | Print currently Working Directory | Yes |
quota | No | Display disk limitation and usage | Yes |
rcp | No | Copy files across machines/systems | Yes |
read | Yes | Read first line from an output file | Yes |
readonly | Yes | Assign read only attribute to a file/directory | Yes |
reboot | Yes | Reboot a system | Yes |
return | Yes | Exit Function | Yes |
rev | No | Reverse file lines | NA |
rm | No | Remove file(s) | NA |
rmdir | No | Remove directory(ies) | Yes |
rpm | No | Bring up Remote Package Manager tool | Yes |
rsync | No | Remotely copy a file | NA |
say | No | Text to speech conversion | NA |
screen | No | Manage Multiplex terminal and run remote shells via ssh | NA |
screencapture | No | Capture the screen image | Yes |
sdiff | No | Merge or modify two files | Yes |
security | No | Configure security options for a system | Yes |
sed | No | Stream Editor Utility | NA |
select | Yes | Display list of Items | Yes |
set | Yes | Set shell variable | Yes |
setfile | No | Set file attributes | NA |
shift | Yes | Shift positional parameters | Yes |
shopt | Yes | Configure shell options | Yes |
shutdown | No | Shutdown/restart Mac OS X | NA |
sleep | No | Sleep after an assigned time frame | Yes |
softwareupdate | No | Software Update Command | Yes |
sort | No | Sort the text files | Yes |
source | Yes | Execute command from file | Yes |
split | No | Split files into like sized pieces | NA |
stop | No | Stop a process or currently running job | NA |
su | No | Substitute a user identity | Yes |
sudo | No | Execute command as some other user | Yes |
sum | No | Print checksum value for a file | NA |
suspend | Yes | Suspend shell execution | Yes |
sw_vers | No | Print Mac Operating System version | NA |
system_profiler | No | Report a system configuration | Yes |
tail | No | Display the last lines from a file | NA |
tar | No | Archiver Utility | Yes |
tcpdump | No | Network Traffic dump | NA |
tee | No | Redirect multiple file output | NA |
test | Yes | Conditional evaluation | Yes |
textutil | No | Modify Text file formats | NA |
time | No | Calculate Program Resource Usage | Yes |
times | Yes | Print shell along with shell process time | Yes |
top | No | Display process related information | Yes |
touch | No | Change the file timestamps info | Yes |
tr | No | Modify Characters or delete them | NA |
traceroute | No | Display Trace Route path to assigned host name | NA |
trap | Yes | Execute command when shell receives signal | Yes |
tty | No | Print terminal filename on stdin | NA |
type | Yes | Describe command name and type | Yes |
ufs.util | No | Mount or unmount a UFS file system | NA |
ulimit | Yes | Limit system resources usage | Yes |
unalias | Yes | Delete an alias | Yes |
unamask | No | Mask User file creation | NA |
uname | No | Print System Info | Yes |
unexpand | No | Space to tab converter | Yes |
uniq | No | Uniquify the files | Yes |
units | No | Unit scale converter command | NA |
unmount | No | Unmount a mounted device | NA |
unset | Yes | Remove function or variable names | Yes |
until | Yes | Loop command | Yes |
uptime | No | Display System Runtime information | NA |
users | No | Print all username of the current session | NA |
uucp | No | Unix to Unix copy command | Yes |
uudecode | No | Decode a file | NA |
uuencode | No | Encode a file | NA |
vi | No | Visual Text Editor | Yes |
wait | Yes | Wait for process completion | Yes |
whatis | No | Search what is database | NA |
where | No | Report all command instances | NA |
while | Yes | Loop command | Yes |
who | No | Print all names of the users of the current session | NA |
whoami | No | Display or Print current username and info details | NA |
write | No | Send a user a message | NA |
xargs | No | Execute utility by passing arguments | Yes |
yes | No | Print a string value until and unless interrupted by a user | NA |
Foot note: N/A – Data not available.
If you feel this list lacks any particular command which has been recently added to the Mac terminal, you can improve this article by mentioning it in the comment section.
Terminal is not for mere mortals, you're probably thinking. It's a kind of a sacred knowledge that only geeks and Mac geniuses possess. But if you get through your first command line you'll find it's not that terrifying. In fact, using Terminal is like applying Harry Potter wizardry to your tasks. Once you know the right spells you can break any laws of how applications behave and do some unbelievable things that even the most experienced Mac people can't. Isn't it seducing to try?
We've chosen just a few of Terminal's most impressive features. For more serious take on Mac terminal commands, check out this article. Okay, are you ready to type in your first code? To start the journey, learn how to open Terminal app on Mac: Click Launchpad and then type Terminal in the search bar.
1) Make your Mac talk to you
One of the simplest commands which can be very fun, especially when you are planning a prank on somebody. Just type any text in Terminal and your computer will speak it in your Mac's default voice. But there's about 20 voices and intonations to choose from plus the ability to convert an entire text file into speech. So here's a slick audiobook maker at your hand.
Open up Terminal, type in:
say followed by a space and any text you want to hear
2) Customize Login Message
This is what makes Mac more personal and humanized. For example, you can write an inspirational motto or helpful information for other users, if it's a public library computer. It might even be a way to retrieve your MacBook if you lose it — if you set a login message with your contact information. Once again there's much room for pranking other people, but we won't go deep into that.
Open up Terminal, type in:
Commands For Terminal On Mac
sudo write /Library/Preferences/com.apple.loginwindow LoginwindowText 'Custom Text Here'
3) Watch Star Wars in Terminal app
In Terminal symbols, of course. This could be the greatest trick which makes no particular sense, but even if just for the coolness alone you should try it. The Death Star, R2D2, spaceships and the rest of the Episode 4 story retold in Terminal graphics will blow your friends away at the party. And there is no sound by the way.
Open up Terminal, type in:
telnet towel.blinkenlights.nl
On macOS Sierra and higher macOS versions, you should use a different command:
nc towel.blinkenlights.nl 23
Mac Terminal Commands Cheat Sheet Pdf
4) Show hidden files in Finder
This isn't as funny as the previous one, but searching for important files is no joke. With this command, you'll be able to see everything on your Mac, even files which were omitted from standard display.
Open up Terminal, type in:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
This should summon Finder with previously hidden files shown grayed out.
To reverse this operation (be aware that you may be swamped with lots of irrelevant system files) just substitute TRUE for FALSE in the command line above:
Mac Terminal Commands Pdf
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
5) Pay a visit to a psychiatrist
Funny Mac terminal commands are many. This is a classic Easter egg type of joke macOS developers are famous for. When you're feeling stressful, talking to friendly chatbot will at least make you smile. Strangely enough, this therapy may be actually working because you are asked to verbalize your emotions, by giving them a closer look. And the psychiatrists (the real ones) will confirm that sometimes it works.
Open up Terminal, type in:
emacs and then hit Return. Press Esc, then x, and finally type doctor
6) See iTunes songs notification via Terminal app
A clever addition if you normally work with the music on the background. If you fell in love with a particular track from your playlist you don't need to open iTunes to find out the artist's name. It will pop up on your Mac Dock from now on. Though a bit strange this feature isn't included by default because it's really a timesaver.
Open up Terminal, type in:
defaults write com.apple.dock itunes-notifications -bool TRUE
Close the dock using the following command:
killall Dock
7) Play simple games
List Of Commands For Terminal On Mac
This is another retro cool feature to cheer you up once in a while. You can play Tetris, Pong, Snake and a dozen of other arcade games. Once you have unlocked these nice hidden toys, you'll surely get to love your Mac more. Prepare to use your arrow keys.
Open up Terminal, type in:
emacs. Press Enter to open it up, press Esc then x. Now you have to type the name of the particular game and that's it.
Game names:
- tetris
- pong
- snake
- solitaire
- 5x5
- landmark
- doctor
What you learn from using Mac Terminal commands is that nothing is really impossible if you're on a Mac. But it's better to start your Terminal experience with these funny little tricks and then go to something serious. This program has a nearly infinite number of magic spells to choose from.
8) Make your Mac faster and more responsive
Okay, this has nothing to do with Terminal. But who wouldn’t want their MacBook as speedy and efficient as back then, on its first day? Surprisingly, this can be achieved easily, Terminal-style way — with aid of CleanMyMac X.
- Remove up to 74 GB of junk from your Mac
- Uninstall unwanted apps completely
- Speed up Mac with maintenance scripts
- Fully clean browsers and messengers
Download the app from developer’s site for free
Hope you found this article helpful, stay tuned for more!