Linux basic Commands (ii)

Source: Internet
Author: User
Tags file permissions

1) grep text filter
Syntax: grep [options] mode or keyword file list
--clolor color display matches to the keyword
-I ignores case
-V Take reverse
^ Start with a keyword
$ ends with a keyword
^$ Empty Line
The number of rows to which the-C statistic matches
-L is used with-R to display only the name of the file containing the keyword
-R Recursive display
-Q Silent Output (used when writing scripts)
-N Displays the line number of the matching row
2) Cut intercept
Syntax: cut-f specifies the column-d ' delimiter ' (-d specifies the field delimiter,-f specifies the range to be output, and more than one comma-delimited,-c-specified column character)
3) sort order (-t Specify field delimiter,-K to specify the number of fields,-N to sort by numeric,-R to reverse, and-u to sort after duplicate rows to print once)
4) Uniq ' only (-C displays the number of repeated rows,-I ignores case) first sort and then go to heavy
5) TR main role text conversion or deletion, paste text merge, middle using tab-separated,-D to specify the delimiter between the rows of the merged file
6) Users and Groups
1. User: Identity used for different functions of the operating system
Users in 2.Linux: Root uid=0, System user, normal user
3. Create User: Useradd username
Delete User: Userdel username
Set User password: passwd username
Modify user information: Usermod-[u, G, G] username
View Current User: ID
View specified User: ID LP
4. Create Group: Groupadd groupname
Delete Group: Groupdel groupname
Modify group information: Groupmod groupname
Delete Group member: gpasswd-d username Group
5.usersdd
-U Specify user uid
-G Specify user gid
-g Specifies the subordinate group
-C Develop a description
-D Specify home directory
-M do not set up home directory
-S Specify shell
-e Specify user expiration time (date)
-F Specify user Expiration Time (days)
6.usermod
-L Lock User
-U Unlock User
-L Renaming
-A Add user to group
7.passwd
-L Lock User
-U Unlock User
-N Password minimum usage period (days)
-X Password maximum lifespan (days)
-W Reminder days before expiration (days)
7) Basic Permissions
1. Documents
R: Readable
W: Writable
X: Executable
2. Catalogue
R: Can execute LS on this directory
W: You can create files in this directory
X: You can switch with CD
3.chown Change file owner (root use)
-R Modify the owner of the directory and internal files
4.chmod Modifying file permissions

Linux basic Commands (ii)

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.