User and group management related commands are described and used:In general, the commands involved are: Useradd,usermod,passwd,userdel,groupadd,groupmod,gpasswd,groupdel,chage,chsh,chfn,id,w, Who,whoami, Su,finger1, useradd:create a new user or
creating, modifying, and deleting user accounts under the Linux system character interface mainly uses the 3 commands of Useradd,usermod and Userdel.I. Create a user accountCreate a user account is to create a new account in the system, and then
creating, modifying, and deleting user accounts under the Linux system character interface mainly uses the 3 commands of Useradd,usermod and Userdel.I. Create a user accountCreate a user account is to create a new account in the system, and then
1. What is the difference between sed and awk?(1) Awk: Operations by column (domain); sed: line by row(2) awk: Text processing language, suitable for extracting text; SED: non-interactive editor for editing text2. Which parameter does awk use as a
1. Delete the blank characters from the beginning of the/etc/grub.conf filesed [email protected]^[[:space:]]*@@ '/etc/grub.conf2. Replace the number in the "Id:3:initdefault:" line in the/etc/inittab file with 53. Delete blank lines in
Author: cnbird t00ls.net
I. php file system path normalization attackUse // and/. In the path to open/etc/passwd/or/etc/passwd/. As a file.Ii. Path Truncation Attack in PHP File SystemPHP has a path truncation problem (a very evil means snprintf ().
1 redirection
1.1 redirection symbols
> The output is redirected to a file or device to overwrite the original file.>! The output is redirected to a file or device to forcibly overwrite the original file.> The output is redirected to a file or
Sort
The sort command sorts the rows in the file specified by the file parameter and writes the result to the standard output. If the file parameter specifies multiple files, the sort command connects these files and sorts them as one file.
Sort
Format: awk '{Pattern + action}' {filenames}
Common parameters:
-F specifies that the Delimiter is a space by default.
Start with begin printing
End print end
Built-in Variables
Number of argc command line parameters
Argv command line parameter
Common Linux advanced file operation commands
Cat view text# Cat file name print the file content to the current screen# Cat-n the row number displayed for the file name# Cat> a.txt can be used to modify or create a file.Manually enter textContinue
In Linux),), (, (redirection and pipeline commands
1 redirection
1.1 redirection symbols> The output is redirected to a file or device to overwrite the original file.>! The output is redirected to a file or device to forcibly overwrite the original
Content of this week's job:1. List the user name of all logged-in users on the current system, note: The same user logged in multiple times, only once.#who | tr-s [[: Space:]] | Cut-d ""-f1 | Sort-u[email protected] bin]# who | tr-s [[: Space:]] |
1 redirects1.1 Redirect Symbol> Output redirected to a file or device overwriting the original file>! Output redirected to a file or device forcing overwriting of the original file>> output redirected to a file or device to append the original file1.
Linux redirection refers to the modification of the original default of some things, the original system commands the default way to change, such as simple I do not want to see the output of the display but want to output to a file can be done
Sort
The sort command sorts the rows in the files specified by the file parameter and writes the results to the standard output. If the file parameter specifies multiple files, the sort command connects the files and sorts them as a file.
Sort
1 redirects 1.1 Redirect Symbol > Output redirected to a file or device overwriting the original file>! Output redirected to a file or device forcing overwriting of the original file>> output redirected to a file or device to append the original
Pipeline command (pipe)As we said earlier, the output data will appear when the bash command executes! So if this group of data must go through a few formalities to get the format we want, how should we set it? This involves a problem with the
1. Display lines starting with size s in the/proc/meminfo file (required: use two methods)# Cat/proc/meminfo | Grep-i ' ^s '# grep ' ^[ss] '/proc/meminfo2. Display lines in the/etc/passwd file that do not end in/bin/bash# grep-e '/bin/bash$
1, Os.system ()External programs executed by this method will output the results directly to standard output. Os.system The return result for executing shell $? Value.Therefore, it is appropriate to use this method when executing programs that do
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.