Getting Help in Shell
There are basically two kinds of commands in the Linux world: Internal and external. Internal commands are functions built into your shell. External commands are programs installed on your system.
You can visit here for more detailed information about the differences between internal and external commands.
Internal Command Help on Linux
There are different tools you can use to get help with internal commands, ie shell builtins. Below you will find examples of these tools.
help command, you can get detailed information about shell commands. You can use it as
type command, you can learn the type (internal or external) of the command you will run. You can also learn about your
As can be seen from the above output;
cd is an internal command,
touch is an external command, and
ls is an alias defined as
External Command Help on Linux
There are different tools you can use to get help with external commands. Below you will find examples of these tools.
which command shows from which path the external command you typed will be called:
According to the above output; the
ls command runs the program at the
/usr/bin/ls path, while the
useradd command runs the program at the
/usr/sbin/useradd path. Note that no output is produced for the internal command
whatis command, you can extract a single line of information from the man pages and learn about the command. Similarly, it is possible for you to learn about configuration files. The
whatis resolv.conf command in the example below is an example of this situation.
One of the biggest saviors of Linux system administrators, the
man command is a tool that allows you to view the manual pages on the system.
man commandname you can access the manual pages written about commands.
NAME ls - list directory contents SYNOPSIS ls [OPTION]... [FILE]... DESCRIPTION List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort is specified. Mandatory arguments to long options are mandatory for short options too. -a, --all do not ignore entries starting with . -A, --almost-all do not list implied . and .. --author with -l, print the author of each file -b, --escape print C-style escapes for nongraphic characters