Basic Commands

Getting Help
How do you get help for the syntax of a command in linux? It depends on the command. If it is an internal shell-command, 'help' is used. If not, 'man' or the '--help' option is used.

Internal Shell Commands
The internal commands are part of the shell you are using (e.g. bash). try these examples:

Display a list of the internal commands: $ help GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu) These shell commands are defined internally. Type `help' to see this list. Type `help name' to find out more about the function `name'. ... $ help for    display the syntax for using the 'for' command for: for NAME [in WORDS ... ;] do COMMANDS; done The `for' loop executes a sequence of commands for each member in a    list of items. If `in WORDS ...;' is not present, then `in "$@"' is    ...

Other Commands
the rest of the commands are located as files on the computer.

$ man cp        display the manpage for 'cp' ... $ cp --help     display short information for 'cp' Usage: cp [OPTION]... SOURCE DEST or: cp [OPTION]... SOURCE... DIRECTORY or: cp [OPTION]... --target-directory=DIRECTORY SOURCE... Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too. -a, --archive               same as -dpR --backup[=CONTROL]      make a backup of each existing destination file ... $ which cp      show the location of the program 'cp' /bin/cp