In the previous blog we introduced the Linux file Search command, where find is the most powerful file or directory Search command, and another search command locate the difference is that the Find command is a full search, the newly created file can also be searched, and locate is in the file database search, compared to find command search faster, but the newly created file if not included in the file repository, using the Locate command is not searchable, and then/tmp directory is not included in the file database, This means that the locate command is used to search for files that are not in the/tmp directory. Then we describe the directory where the search command is located and the alias information which, the directory where the search command is located, and the Help document path Whereis, the last command grep and the previous search file or directory command is different, grep is to search for a matching string in the file, is in the file content search, This command is used more later, you need to remember the usage.
So this blog we continue to introduce Linux commands--HELP commands and user management commands.
1, help command one, get command or configuration file help information: Man
①, command name: Man
② and English original meaning: manual
③, command path:/usr/bin/man
④, execute permissions: All Users
⑤, function Description: Get help information
⑥, Syntax: Man "command or configuration file"
Example 1: View the Help information for the LS command: Man ls
Example 2: View the Help information for profile services: Man services.
Note that viewing the configuration file does not require an absolute path, and if it is man/etc/services, then the file content of the services is displayed.
If the file is a command, but also a configuration file, such as Man passwd, the system is a priority to display the command help information. If you want to see passwd profile information, you can have man 5 passwd. Because 5 represents the profile information, 1 represents the command help information.
Ii. get help with Shell built-in commands:
①, command name: Help
② and English original meaning:
③, command path: Shell built-in commands
④, execute permissions: All Users
⑤, function Description: Get shell built-in command help information
⑥, Syntax: Help "shell built-in Commands"
Example: View the Help for the umask command: Helping Umask
How do we tell if a command is a shell built-in command? Before we talked about the which command, which is used to search for the directory and alias information of the command, if you use which to find the path of the command, then this command is the shell built-in command.
The following commands are shell built-in commands:
Third, obtain the command of the Chinese Help information:--help
Here's a simple trick, if we want to simply look at the command's help information, rather than the many things shown above, what do you do?
We execute this command: command--help
Example: Viewing the Help information for LS
2. User Management command One, add a new user: Useradd
①, command name: Useradd
② and English original meaning:
③, command path:/usr/sbin/useradd
④, execute permissions:root
⑤, Function Description: Add new user
⑥, Syntax: useradd "user name"
Example: Adding a user tom:useradd Tom
Second, set the user password: passwd
①, command name: passwd
② and English original meaning:
③, command path:/USR/BIN/PASSWD
④, execute permissions:root
⑤, Function Description: Modify the user's password
⑥, Syntax: passwd "user name"
Note: The root user can modify any user's password. And ordinary users can only modify their own password, and password to comply with the rules of the password, or can not be modified
Example: Modifying a user's password for Tom
Third, view login user simple information: WHO
①, command name: WHO
② and English original meaning:
③, command path:/usr/bin/who
④, execute permissions:root
⑤, function Description: View login user simple information
⑥, Grammar: Who
Example: View information for the currently logged-on user
Iv. viewing logged in User details: W
①, command name: w
② and English original meaning:
③, command path:/usr/bin/w
④, execute permissions:root
⑤, Function Description: View logged in user details
⑥, Syntax: w
Example: View details of the currently logged in user
First row 13:46:28: Current system time up 4 Days:linux continuous Running time 4 days 1 User: Indicates the current 1 user login load average:0.00,0.01,0.05: System load, respectively, for the past minute, five minutes and 15-minute system load condition.
User: Login username
TTY: Login terminal, pts denotes remote terminal, TTY indicates local terminal
From: Log on host IP, if no write indicates native login
3. Summary
This blog we mainly introduce the Linux system Help commands and user management commands. For help commands, the Man command can obtain help for commands and configuration files, and the help command can be helpful for the shell's built-in commands. We can use which to differentiate what is a shell built-in command and what is an external command. But basically, if we're not familiar with a command, we can use the command--help to see the help information more clearly.
Then we introduced the User Management command, for the user Management command after we will be dedicated to a blog to introduce, here is a simple introduction to how to create a new user useradd, how to change the user's password passwd and see the details of the current login W. Note that creating a new user is only possible if the root user has permission to operate, and the user password is changed in addition to the root user.
Linux Series Tutorials (vii)--linux Help and user management commands