Hello everyone, I am Cola, a dedicated original, willing to share the program ape. This series of tutorials will continue to be updated, you can search “IT Cola” on wechat to read the first time. Ebooks has a huge selection of free books that I’ve selected for you

In this blog post we introduced Linux file search commands. Find is the most commonly used and most powerful file or directory search command. The difference between find and locate is that the find command searches the entire file, even the newly created file, while locate searches a file database. The locate command is much faster than the find command. However, if a newly created file is not located in the file database, the/TMP directory is not located in the file database, that is, the/TMP directory cannot be found using the locate command. Then we introduce the directory where the search command is located, the alias information which, the directory where the search command is located, and the help document path whereis. The last command is grep, which is different from the previous command to search for a file or directory. Grep is to search for a matching string in a file. This command is used more later, you need to remember how to use.

So this blog continues with Linux commands – help commands and user management commands.

1. Help commands

Obtain the help information of the command or configuration file: man

Command name: man

②, English original meaning: manual

The command is stored in /usr/bin/man

④ Execute permission: all users

⑤, function description: Get help information

⑥, Syntax: man

Example 1: View the help information of the ls command: man lsExample 2: View the help information for the configuration file services: man Services.

If the configuration file is man /etc/services, the services file is displayed.If a command file is a configuration file, for example, man passwd, the help information of the command is displayed first. If you want to see the passwd configuration file, you can use man 5 passwd. 5 indicates the configuration file information, and 1 indicates the help information of the command.

Get the help information of the shell built-in command: help

① Command name: help

②, English original meaning:

3. Command path: shell built-in command

④ Execute permission: all users

Function description: Get help information of shell built-in commands

⑥, syntax: help [shell built-in command]

Example: View the help information of the umask command: help umask

How do we know if a command is a built-in shell command? Previously, we mentioned that the which command is used to search for the directory and alias information of the command. If you cannot find the path of the command using which, this command is a built-in shell command.The following commands are all built-in shell commands:

Get command help information in Chinese: –help

Here’s a simple tip. What if we want to simply view the help information for a command, rather than the many things shown above?

We execute this command: the command –help

Example: View the help information for LS

2. User management commands

Add a new user: useradd

① Command name: useradd

②, English original meaning:

The command is stored in /usr/sbin/useradd

4. Execute permission: root

⑤, function description: Add new users

⑥, syntax: useradd

Example: Add user Tom :useradd Tom

Set the user password to passwd

1. Run the passwd command

②, English original meaning:

3. The command path is /usr/bin/passwd

4. Execute permission: root

⑤, function description: Modify the user password

⑥, syntax: passwd [username]

Note: The root user can change the password of any user. A common user can only change his or her own password, and the password must comply with the password rules; otherwise, the password cannot be changed

Example: Change the password of user Tom

3. View the simple information of the login user: who

① Command name: who

②, English original meaning:

The command is stored in /usr/bin/who

4. Execute permission: root

Function description: View the simple information of the login user

⑥, Grammar: who

Example: View information about the current logged-in user

4. View the login user details: W

Command name: w

②, English original meaning:

The command is stored in /usr/bin/w

4. Execute permission: root

Function description: View the details of the login user

⑥, Grammar: W

Example: View details about the current logged-in user13:46:28: Current system time up 4 days: Linux running time for 4 days 1 user: Indicates that one user logs in. Load Average :0.00,0.01,0.05: indicates the system load in the past one minute, five minutes, and 15 minutes respectively.

USER: indicates the login USER name

TTY: Indicates the login terminal. PTS indicates the remote terminal and TTY indicates the local terminal

FROM: indicates the IP address of the login host

3, summarize

This blog introduces the help commands and user management commands for Linux. For help commands, the man command can obtain help information about commands and configuration files, and the help command can obtain help information about built-in commands of shell. We can use which to distinguish between shell built-in commands and external commands. But basically if we are not familiar with a command, we can use the –help command to see the help information more clearly.

Then we introduced the user management commands, for the user management commands later we will use a special blog to introduce, here is a simple introduction to how to create a new user useradd, how to change the password of the user passwd and view the details of the current login w. Notice Only the root user has the permission to create a new user, but the root user can also change its password.

This series of tutorials will continue to be updated, you can search “IT Cola” on wechat to read the first time. Reply ebook has a selection of books that I have selected for you