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 echoShort help
The --help flag prints a short manual. This one is for bash, the shell itself.
bash --helpWhat kind
type says what kind of command a name is. A builtin is a command the shell carries inside itself.
type echoA program file
bash is a program file, not a builtin.
type bashWhere it lives
which prints the path of a program file.
which bashEcho as a file
which finds a program file for echo too.
which echoExample
type echo
type bash
which bashKey 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?