Generally, one uses the shutdown
command. It allows a time delay and warning message before shutdown or reboot, which is important for system administration of multiuser shell servers; it can provide the users with advance notice of the downtime.
As such, the shutdown command has to be used like this to halt/switch off the computer immediately (on Linux and FreeBSD at least):
shutdown -h now
Or to reboot it with a custom, 30 minute advance warning:
shutdown -r +30 "Planned software upgrades"
After the delay, shutdown
tells init
to change to runlevel 0 (halt) or 6 (reboot). (Note that omitting -h
or -r
will cause the system to go into single-user mode (runlevel 1), which kills most system processes but does not actually halt the system; it still allows the administrator to remain logged in as root.)
Once system processes have been killed and filesystems have been unmounted, the system halts/powers off or reboots automatically. This is done using the halt
or reboot
command, which syncs changes to disks and then performs the actual halt/power off or reboot.
On Linux, if halt
or reboot
is run when the system has not already started the shutdown process, it will invoke the shutdown
command automatically rather than directly performing its intended action. However, on systems such as FreeBSD, these commands first log the action in wtmp
and then will immediately perform the halt/reboot themselves, without first killing processes or unmounting filesystems.
whatis
displays one-line manual page descriptions, intended to give you a general idea of what a program do,
while apropos
searches the manual page names and descriptions, intended to help you to learn what program to use when performing a certain job.
Some examples
Say, I want to know what does df
program do. whatis
gives me answer.
$ whatis df
df (1) - report file system disk space usage
And now, I want to unzip an archive. apropos
gives me some choises for consideration.
$ apropos unzip
bunzip2 (1) - a block-sorting file compressor, v1.0.6
funzip (1) - filter for extracting from a ZIP archive in a pipe
gunzip (1) - compress or expand files
lz (1) - gunzips and shows a listing of a gzip'd tar'd archive
preunzip (1) - prefix delta compressor for Aspell
unzip (1) - list, test and extract compressed files in a ZIP archive
unzipsfx (1) - self-extracting stub for prepending to ZIP archives
uz (1) - gunzips and extracts a gzip'd tar'd archive
UPDATE:
Since both whatis
and apropos
search man database, you can only get info on what's already installed on your system.
Best Answer
From the
findutils
find
manpage:(
-print
is afind
expression.)The POSIX documentation confirms this:
So
find .
is exactly equivalent tofind . -print
; the first has no expression so-print
is added internally.The explanation of what
-print
does comes further down in the manpage: