![]() ![]() If then # if no arguments provided, prompt userĮcho -n “What command(s) are you asking about?> “įor cmd in `echo $args` # for each command enteredĮcho “=” In fact, it can accept a list of commands and display the command output for looking into each of them. The script below will run all three commands and display the output in a useful format. Your personal bin directory should probably not be sitting in the first position in your $PATH variable nor should “.” (current position) because of the risk of running a command other than what you intended. In this case, which one you end up running will at least in part depend on your search path. While you’re very unlikely to get a response like that shown, it is possible to have two executables on a system with the same name. Hmm! Something’s just a little off in that example. ![]() If you run a command and get an unexpected response, checking out what executable you’re dealing with can be important. You can run all three of the which, whereis and whatis commands any time you want to know a little more about the commands you’re running and where they are stored on your system. etc/passwdħ Miscellaneous (including macro packages and conventions), e.g.Ĩ System administration commands (usually only for root) Man pages are organized into as many as 9 sections: 1 Executable programs or shell commandsĢ System calls (functions provided by the kernel)ģ Library calls (functions within program libraries)ĥ File formats and conventions, e.g. Shutdown-shut down socket send and receive operations Linux manual page for details of Linux behavior), or the interface may Implementation of this interface may differ (consult the corresponding This manual page is part of the POSIX Programmer’s Manual. SHUTDOWN( 3P) POSIX Programmer’s Manual SHUTDOWN( 3P) Note that at the top of the man page you will see a confirmation of the command and the particular man page section: Add the man page section (e.g., “man 3p shutdown”) for a different man page section. To view the primary man page for any command, just type “man” plus the name of the command, for example, “man date”. Shutdown (8) - Halt, power-off or reboot the machine Shutdown (3p) - shut down socket send and receive operations ![]() Shutdown (2) - shut down part of a full-duplex connection $ whatis dateĭate (1) - print or set the system date and time Each description is associated with one of the man pages for that command as shown in the example below. The whatis command provides brief descriptions of commands. Shutdown: /usr/sbin/shutdown /usr/share/man/man2/shutdown.2.gz /usr/share/man/man3p/shutdown.3p.gz /usr/share/man/man8/shutdown.8.gz $ whereis dateĭate: /usr/bin/date /usr/share/man/man1/date.1.gz /usr/share/man/man1p/date.1p.gz In the example below, there are two or three man pages for each of the commands. Like which, the whereis command will show you the file=system location for the executable associated with a command, but it will also tell you where the man (manual) pages are located. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |