How To Get Out Of Bsd Commands Manual Terminal Mac

10.3: See all possible BSD commands in the Terminal. You can get the same thing using tab completion (in bash at least). During typing, you can hit tab, and it will autocomplete what you are typing based on context. If there are mulltiple completions possible, it will just beep at you.

The OS X Terminal is a very powerful tool for configuring and using a Mac, and can be used to script and program a number of aspects of the computer's operations; however, its text-based interface can be a bit of a cryptic environment to first-timers, especially when it comes to finding out what you can use it for.

There are thousands of Terminal commands available, but when you first launch it you might not have a clue where to look for them. Of course there are basic commands like 'ls' for listing directory contents or 'cd' for changing directory, but in addition there are text editors, string parsers, expression managers, and numerous other commands that, depending on the purpose, can make the Terminal a hidden but exceptionally powerful tool.

If you are just getting started with using the Terminal, you may find it useful to build your command vocabulary. There are many resources such as the BSD Unix command summary that will give you a quick overview of the common commands; another approach is to list all commands available to you and then look up the manual page of each individually to see what its purpose is and how it's used.

There are a number of ways to list all of the commands, but two quick ones are Tab completion and the 'compgen' command. For Tab completion, simply type something in Terminal and hit Tab once or twice (and if prompted, confirm that you want the options displayed) and the system will list all available commands based on the text you entered.

If you press the Tab key without having entered any text, then the Terminal will output all possible commands (after you confirm that you want it to do so). If you do this, it helps to make the Terminal window as large as possible. You can then press Enter to display more items that are off the page until you are dropped to the command prompt again, but then you can scroll up and down to review the commands that were listed.

The second option is to list the commands and aliases available to you using the 'compgen' built-in command. Simply type the following command, and you will be given the full alphabetical list of commands available to you in the system:

compgen -ca

You can also redirect the output to a text file on your desktop called 'commands.txt' to peruse later:

compgen -ca > ~/Desktop/commands.txt

Referring to this list of commands, you can then look each up using the Terminal commands 'man' for the full manual page or 'whatis' for a brief synopsis of what it does. For instance, unlike the command 'diskutil' it may be difficult to guess what the command 'xattr' does from its name, so you can quickly look this up by running the following:

whatis xattr

Note: If the whatis command is not working then run the command '/usr/libexec/makewhatis' in the Terminal.

You can find more information and specifics on how to use the command through its manual page. There are a number of approaches to viewing a manual page for a command, with four that may be most useful:

  1. The man command
    The default way to view a manual page is to use the man command the way the whatis command is used above, which will bring up a formatted instruction manual for the command that you can navigate through with the arrow keys or the F and B keys (for forward and backward). For example, to view the manual page for the xattr command, you would run the following:

    man xattr


    To quit the manual page, simply press the Q key.
  2. The 'xman' command
    If you have XQuartz installed or Apple's provided X11 windowing system for Unix (provided by Apple in OS X Lion and previous versions), then you can run the 'xman' command to open up a manual page browser that you can click through. This is a quick and convenient way to not only view the manuals, but also see the available commands.
  3. The Web
    A third resource is various Web sites that contain collections of man pages for commands. An easy approach is to simply do a Web search for 'man COMMAND;' however, this may bring up platform-specific manual pages that do not completely pertain to the command in your version of OS X. A more Mac-specific man page collection is Apple's OS X Manual Pages site.
  4. Third-party man page utility
    A final option is to use a third-party manual page tool, such as OnyX, which contains a full man page browser. Like the xman utility, this will give you a quick way to view available commands and study their manual pages. In addition, OnyX provides an option to save the manual pages as PDFs.

Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.


How to get out of bsd commands manual terminal mac os

How To Get Out Of Bsd Commands Manual Terminal Mac 2017

10.3: See all possible BSD commands in the Terminal | 17 comments | Create New Account
Click here to return to the '10.3: See all possible BSD commands in the Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: See all possible BSD commands in the Terminal

You can get the same thing using tab completion (in bash at least). During typing, you can hit tab, and it will autocomplete what you are typing based on context. If there are mulltiple completions possible, it will just beep at you. You can then hit tab twice and it will show you the possible options. Hitting tab twice on a blank line will show you all available because it is trying to auto-complete what you haven't typed yet.
Fo those that didn't know about tab-completion, it is particularly helpful for navigating through dirs. Type /path/to/some/dir/ and then hit tab twice and you will get all of the files and dirs in that dir.

10.3: See all possible BSD commands in the Terminal

How To Get Out Of Bsd Commands Manual Terminal Machine

not just a panter hint. works in jaguar as well.
---
'It is better to deserve honors and not have them than to have them and not deserve them.'
-Mark Twain

10.3: See all possible BSD commands in the Terminal

In tcsh, you can type command x, then command d to display all of the commands. Jaguar 10.2.8 and earlier.

10.3: See all possible BSD commands in the Terminal
10.3: See all possible BSD commands in the Terminal

Doesn't work for me in tcsh (using control). Am I missing something?
Man (tab) used to work to list all commands in tcsh. It quit working sometime back.

How To Get Out Of Bsd Commands Manual Terminal Mac

I get 1612 possibilities!
I hadn't realized that I had installed so many extra command-line programs.

10.3: See all possible BSD commands in the Terminal
10.3: See all possible BSD commands in the Terminal

This just seems to be equivalent to the 'Tab' key auto completion feature in the bash shell. You can even filter the list by typing a few letters of the command you are interested in.
I have to admit though, I was always curious as to how I could find out all of the commands available to me on a system. (983 in my a stock Panther client)
For those of you that have more than the stock number of commands, what are your favorite or most useful add ons?

How To Get Out Of Bsd Commands Manual Terminal Mac Command

10.3: See all possible BSD commands in the Terminal

In zsh, you can type backslash followed by the tab command and it will list all possibilities of executables in your path and shell commands.
[tab-key]
zsh: do you wish to see all 3319 possibilities (837 lines)?
My personal favorite is called wtf
You put in an acronym, and it decodes it:
zsh-% wtf lmao
LMAO: laughing my ass off

That's great. If you don't have it on your system, you can get it from fink: sudo fink install wtf
10.3: See all possible BSD commands in the Terminal

Did not get the Show All Commands by pressing TAB or ESC twice in the Panther default shell.
Did fink and compile WTF however.....most cool!

In my bash shell (ever since 10.1, I think), just hitting tab twice prompts to show me all programs.
This is standard Unix shell completion. What's going on is that hitting tab tries to complete whatever you've been typing. If there isn't a single matching completion, hitting it again will show the list of possible completions. If that list is over a certain length , it prompts you before spitting them all to the terminal.
So, as a few practical examples, if you want to find a decent subset of all the X11 applications you could run (they often start with the letter 'x', just by convention), type x[tab][tab]
This also works with completion not of applications, but of items in your directories. So let's say you were curious about how many of those X11 applications live in /usr/bin/, you could type
$ cd /usr/bin/
$ ls x[tab][tab]
for me, it yields:
$ ls x
xargs xml2-config xmllint xsubpp
xcodebuild xmlcatalog xstr xxd
$ ls x
tab completion in the shell becomes like breathing eventually. Less than half the commands I use do I ever type all the way out myself, and even fewer of the documents that I edit.

Oh, and if it's a competition, I'm at 2101 possible commands. I'm sure someone can beat that, though. :-)

10.3: See all possible BSD commands in the Terminal

If you want a list with descriptions that you can save to a file try this:
apropos .*

10.3: See all possible BSD commands in the Terminal

For those (like myself) who prefer tcsh, the same thing can be done using CONTROL-D. For example, typing 'm' followed by ^D will show you all commands starting with m... or 'mk^D' shows all commands starting with 'mk'.
There is no simple way to make it show ALL commands- pressing ^D on an empty command line will either log you out, or if you have 'set ignoreeof' in your .tcshrc file it prints 'Use 'logout' to logout.' This is because in *nix the ^D character means 'end of file', and some shells treat an interactively-typed ^D the same way they would an end-of-file when executing a script... they stop running.

How To Get Out Of Bsd Commands Manual Terminal Mac Os

10.3: See all possible BSD commands in the Terminal
10.3: See all possible BSD commands in the Terminal

This is not completely true, and is not a panther feature. All *NIX OS's with the bash shell, or variants of, have this capability. Also, you are only seeing commands that are in your path. If your path is anything but default, new software added, complied, etc, you see what that shell has a path to execute.