How to List Every Terminal Command on Mac OS
Have you ever wanted to know what every single possible terminal command was on a Mac? You can list every terminal command available by turning to the command line. What you’ll see is a significant list of terminal commands with over 1400 possible commands to investigate and use, many of which are either helpful or powerful as we regularly cover with our command line guides. Of course many of the commands listed will have no relevance to the average user, but it can still be helpful to be able to navigate through the list and investigate each command and its respective purpose.
We’ll show you how to list every single terminal command available on a Mac, as well as how to get an explanation and details on each specific command that is shown.
How to Show Every Terminal Command Available in Mac OS
This trick will reveal every single possible terminal command available to Mac OS and Mac OS X. It works in all versions of Mac OS X system software as long as you are using the bash shell, which is the default in all modern releases.
- Open the Terminal app found in /Applications/Utilities/
- At a fresh bash prompt, hit the Escape key twice
- You will see a message stating “Display all 1460 possibilities? (y or n)” type “y” key to start showing every command available
- Hit the Return key to scroll through the huge list of commands available
- Hit the “Delete” or backspace key to escape the command listing when finished
You’ll see a truly exhaustive list of commands available, some of which may be familiar to advanced users and many commands which even pro users likely have never seen or used before.
Of course you’re now probably wondering what each command might do, or how to investigate what the shown commands do. That’s easy as well.
Getting Info & Explanation for Each Terminal Command
You can easily retrieve information and an explanation on any of the shown commands by using the handy open man page trick, which will launch a manual for the chosen command into a new terminal window. Here’s how it works in the context of the all inclusive commands list on Mac OS:
- Right-click on any command listed you wish to investigate and explain further
- Choose “Open man page”
- The manual page for the selected command will open in a new terminal window to explain the command
You can also use the Terminal app “Help” menu to quickly launch manual pages by searching for a specific command there. Additionally, if you want to find related commands or related instructions, you can use this trick to search manual pages for matches containing a specific keyword or command.
The command line has literally thousands of commands available to use, if you’re interested in learning about specific terminal tricks be sure to read through out command line posts.
Anyone know of a command that will give you TOTAL time a Mac was used?
Tired ‘ac’ but that seems to be limited to the last 6 months of records and does not go beyond that.
Didi you consider:
compgen -A function; alias
Not only not exhaustive/exhausting, but actually … relevant?
Hi
While performing some research I collected a few thousand image and video files.
To report my data, I need to search specific directories and count all files by their actual creation date and output the results to csv.
My challenge is knowing the syntax required to count files using a metadata property such as “kMDItemContentCreationDate”.
I’d like the final report format to resemble this structure:
DD/MM/YYY FILE TYPE COUNT
01/01/2017 .JPG 12
02/01/2017 .JPG 19
03/01/2017 .JPG 11
04/01/2017 .JPG 27
I have tried to find the string I need, but so far with no success and it has been driving me crazy trying in the process.
Are you able to please guide as what is necessary to achieve my desired outcome?
For the love of God, it’s not Mac OS. It’s macOS. “Mac OS” hasn’t been around for a good 20 years.
Actually, Mac OS is the name of the operating system that has been around since the Mac debuted, though for a while they called it System.
For the modern era, and according to the Terminal command sw_vers, it’s called “Mac OS X” but I wouldn’t expect a newbie like Christopher who doesn’t know Macs or the command line and instead goes on the latest whims of a marketing team to know that. Oh I’m sorry, it’s not Christopher it’s christophER, obviously.
Uh Oh Christopher, did you need a trigger warning before reading about Mac OS? Poor little Christopher! Do you want a safe space to cry about your Mac OS capitalization scheme? Poor little baby!
Actually he’s right, Apple hasn’t used “Mac OS” since 2001, the final release of Mac OS 9.
The revision history is;
Mac OS X (10.0-10.6)
OS X (10-7-10.11)
macOS 10.12 is current
BTW, the Macintosh used “System” when it debuted until System 7.6 when they changed to Mac OS.
One other thing, ‘sw_vers’ needs to be updated, that’s the only reference to Mac OS X and its an error. Of course it was written in 2003. Use the System Information Utility for accurate software information.
Thank you so much Jeff, for not lambasting me as to hurt me badly. Thank you for presenting the fact that I was trying to lay out there.
Tab for bash is command/path completion. It’s most useful if you only know a part of the command or path. For example typing “ca” then tab produces all the commands that start with “ca”
$ ca
caffeinate calendar cancel captoinfo cat
cal caller cap_mkdb case
Or for example, typing “Do” then tab lists all the directories starting with “Do”
$ ls Do
Documents/ Downloads/
I suppose the count is different depending on what you have installed. Mine clocked in at 2260 entries. I never knew about that man page feature. NEAT.
Yes, the published approach does not work – I typed ESC twice as fast as I could and nothing happened (on ElCap).
But the single TAB is perfect! Thanks for the help getting this to work for me; nice!
And I just found out that in any terminal window — even one open for a long time — pressing TAB TAB also shows you the command list. FYI… I’m using Homebrew bash which is at version 4.4.12; must better than the default bash which is still at version 3.x.
esc twice does work, but you have to do it really fast! Too slow with the second one and nothing happens.
Much easier is just pressing tab (once! twice is not necessary!).
This will show you commands accessible to the shell, but there are more binaries for which documentation is available in other places, e.g. /usr/libexec. Moreover the manual page indexes are not always complete (the “apropos” command won’t always help you find what you need), and the documentation for many daemons is so utterly useless as to be completely absent (as, indeed, it often is).
But it’s a nice trick, all the same.
Can the output be saved into a file?
Shell/Export Text As… saves the Terminal buffer to a file.
YES!! tab, tab. ESC did nothing for me, thanks!
forgot to concur, in Sierra :)
esc twice rapidly works in 10.12.3 You musta paused between.
bc
Always new the command as hitting tab twice, not esc.
I agree, cashxx. TAB TAB does it on Sierra 10.12.3, at least.
Awesome. Thank you!!!