Linux Learning Notes (6) Help commands for Linux common commands and user management commands

Source: Internet
Author: User
Tags touch command

(1) Man

The man command is used to obtain help information for a command or configuration file , the English original is manual, where the path is/usr/bin/man, and its syntax is:

Man [command or configuration file]

Note: You do not need an absolute path to view the Help information for a configuration file .

Viewing the Help for a command primarily looks at the purpose of the command (name) and the corresponding options , while the Help for the configuration file is primarily to view the storage information (name) and its corresponding format . Each configuration file in Linux has a corresponding format.

For help with the LS command, man ls, view the Help for the services configuration file under/ect: Man services.

Exception: When you view the passwd configuration document Help, the Help information for the passwd command is displayed:

Mans passwd PASSWD (1)            User Utilities               PASSWD (1) NAME       PASSWD - update user ' s authentication tokens Synopsis       passwd  [-K] [-l] [-u [-f]] [-d] [-e] [-N mindays] [-x maxdays]       [-< C16>w Warndays] [-I inactivedays] [-S] [--stdin] [username]

Then use the Whereis command to view the path to the passwd:

Whereis passwd passwd:/usr/bin/passwd /etc/passwd /usr/share/man/man1/passwd. 1. gz/usr/share/man/man5/passwd. 5. gz

You can see that passwd exists in two places, where the "1" in man1/passwd.1.gz represents the help of the command, and "5" in man5/passwd.5.gz represents the Help for the configuration file , so You can view help for a configuration file in the following ways:

Mans 5 passwd PASSWD (5)           Linux Programmer ' s Manual         PASSWD (5) NAME       PASSWDfile  DESCRIPTION       Passwd  is  a  text  file, that contains a list of the system ' s
(2) Whatis

The Whatis command provides a brief description of the command , not as fully displayed as a man, in the form of:

Man [command]

Example: Displays a short help message for LS:

ls ls                   (1)  - List Directory contentsls                   (1p)  -List Directory contents
(3) Apropos

The apropos command is used to view short information for a configuration file in the following syntax format:

Apropos [config file]

Example: Displays a short help message for inittab under/etc:

[Email protected] ~]# Apropos Inittabinittab              (5)  -init daemon configuration
(4)--help

a command plus-help to display the main options for the command , such as the main options for displaying the touch command:

Touch -Helpusage:touch  [options] ... File... Change the access time and modification time for each file to the current time. Files that do not exist will be created as empty files unless you use the-C or-h option. If the file name is "-" then special processing changes the access time of the files associated with the standard output. The long option must use parameters that are also required for short options.   -A                    only change the access  time -C,--no-       Create creates no  file -D,--Date= string     representing time instead of current time  - F                    (ignored) using the specified string
(5) Help

The help command is used to obtain a helper message for the shell's built -in command, which uses the Which,whereis command to not find the command that is located on the path , and helps is a built-in command with the syntax format:

Help [command]

Example: Find Help for Umask:

[Email protected] ~]# help Umaskumask:umask [-P] [-S] [mode]     file mode mask.

Note:help can also be used to view assistance for Shell programming if, case, while, and so on .

(6) Useradd

The useradd command is used to add a new user , where the path is/usr/sbin/useradd, with the syntax format:

useradd [user Name]

(7) passwd

The passwd command is used to set the user password , where the path is/USR/BIN/PASSWD, in the syntax format:

passwd [user Name]

Note: Passwords must conform to the password specification.

(8) Who

The who command is used to view login user information , where the path is/usr/bin/who,

W.H.O. root     tty1         --£ ºroot     pts/ 0        ------£ ºPanax notoginseng  

The first root is the login username, the second TTY represents the local terminal, the PTS represents the remote terminal, and the last field is the logon time .

(9) W

The W command is used to view details of the logged-in user , where the path is/usr/bin/w

[Email protected] ~]#W -: to: -Up2: $,2Users, load average:0.04,0.02,0.00USER TTY from [email protected] IDLE jcpu PCPU whatroot tty1-Wed22 5days0.63s0.63s-bashroot pts/0     10.2.108.214Wed220.00s3.80s0.01sW

Where up shows the server running time , loadAverage indicates the load of the server , what indicates thecurrent user is executing the command ,JCPU indicates the cumulative CPU time, PCPU represents the CPU time that the current execution command consumes .

Linux Learning Notes (6) Help commands for Linux common commands and user management commands

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.