🎓 A1Learner
🔍
0 of 50 lessons completed

Shell Getting Help

Help is the text that says what a command does. The shell gives help with man, --help, type, and which.

Manual page

man opens the manual page for a command. Press q to leave it.

man echo

Short help

The --help flag prints a short manual. This one is for bash, the shell itself.

bash --help

What kind

type says what kind of command a name is. A builtin is a command the shell carries inside itself.

type echo

A program file

bash is a program file, not a builtin.

type bash

Where it lives

which prints the path of a program file.

which bash

Echo as a file

which finds a program file for echo too.

which echo

Example

type echo
type bash
which bash

Key points

  • Man: the manual page for a command.
  • Use man echo to open the manual page for echo.
  • Use --help to print a short manual for a command.
  • Use type to say what kind of command a name is.
  • Use which to print the path of a program file.

In this example, the first line says echo is a builtin. The second line says bash is a program file. The third line prints the path of that file.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Exercise

Which command says what kind of command a name is?