usage message

A short line a script prints to standard error when it is called wrongly, showing how it should be run.

In more detail

By convention it starts with usage:, names the options and placeholders, and is followed by exit 2. Putting it in a usage function lets every error path share it.

Example

echo "usage: backup.sh [-v] -d DIR" >&2; exit 2

Related terms

Taught in

References