There is one more common and useful method for obtaining help or documentation about a specific Linux command. Nearly every command supports either -h, -help, or --help as a special option that causes the command to print a brief help message and exit. Listing 18.1 shows one such help message. Listing 18.1. Output of the rm --help CommandUsage: rm [OPTION]... FILE... Remove (unlink) the FILE(s). -d, --directory unlink FILE, even if it is a non-empty directory (super-user only; this works only if your system supports `unlink' for nonempty directories) -f, --force ignore nonexistent files, never prompt -i, --interactive prompt before any removal --no-preserve-root do not treat `/' specially (the default) --preserve-root fail to operate recursively on `/' -r, -R, --recursive remove the contents of directories recursively -v, --verbose explain what is being done --help display this help and exit --version output version information and exit To remove a file whose name starts with a `-', for example `-foo', use one of these commands: rm -- -foo rm ./-foo Note that if you use rm to remove a file, it is usually possible to recover the contents of that file. If you want more assurance that the contents are truly unrecoverable, consider using shred. Report bugs to <bug-coreutils@gnu.org>. Help obtained this way is often very brief, filling less than one screen and providing only the most commonly used options and arguments for a given command. Although the man or info page is almost always more exhaustive, you might find that the -h, -help, or --help options are more readily accessible in day-to-day use.
|