Read a command line
#The first word selects the command; later words become arguments after shell expansion. Options belong to the command, not to the shell.
Fragment
Reference
Read commands, quoting, streams, paths and scripts.
POSIX sh (2017 baseline), Bash additions and named Unix tools. Examples are independent fragments; file paths are illustrative. Bash-only syntax is labeled. macOS and Linux utility flags can differ.
The first word selects the command; later words become arguments after shell expansion. Options belong to the command, not to the shell.
Fragment
Relative paths start at the process working directory. / starts an absolute path; . means here and .. means the parent.
Fragment
command -v reports how the shell resolves a name. PATH lists command search directories, separated by colons.
Fragment
Adding a directory to PATH changes which executable can be selected. Prefer absolute directories: a relative entry (., ./tools or an empty field) resolves against whatever directory the shell is in later.
Assignment has no spaces around =. Export passes a variable to child processes. A prefix assignment applies to that command invocation, except that for special built-ins such as export, : or . (and in some shells for functions) it can persist in the current shell.
Fragment
A child process cannot change its parent’s environment.
Use the installed utility’s manual for its actual flags. Bash help documents Bash builtins; it is not a portable sh command.
Fragment