Linux Commands (ii)

Source: Internet
Author: User

Aliase : Defines an alias for a shell command

Aliases Cmdalias=command

unaliase COMMAND is to revoke the command alias

permissions:r,w,x Each class has three permissions

File:

R: Readable , you can view the contents of the file using commands like cat

W: writable , can edit or delete this file

X: executable, can be submitted to the kernel at the command prompt as a command to run

Directory:

R: You can perform LS on this directory to list all internal files

W: You can create files in this directory

x : You can use CD switch into this directory, or you can use the ls-l View the details of an internal file

User Add Delete

Useradd  [Options] USERNAME Adding users

-U:UID Specifies the user's main ID

-G:GID Specifies the base group ID or group name (this group must first exist to be used)

-G:GID Specifies additional groups, you can specify multiple, separated by commas (this additional group first exists to use)

-C: "COMMENT" Specifies annotation information

-D: Specify the user's home directory, the default is to create a directory with the same name as the user at home.

-S: Specifies the shell, the path is finally the specified shell path in the/etc/shells file

-M: forcing the user to create a home directory

-M: Do not create home directory for new users

-r: Create a System user, system call, do not establish home directory

Userdel  [Options] USERNAME Deleting a user

-r: Delete the user and also delete the home directory

(the home directory is not deleted when no parameters are added by default)

View user Information

ID USERNAME: View user's account attribute information

-U: View UID

-G: View GID

-G: View all groups of users

-un: Displays the user name of the current user

-GN: Displays the group name of the current user

Finger USERNAME : View user account information

Modify User Properties

Usermod  [Options] USERNAME modifying account properties

-U: Modify UID

-G: Modify GID

-G: Modify additional groups

-a–g : Specify new additional groups for the user on the original additional group, without using the -A option overrides the additional group before this

- C : Modify user comment information

- D : Specify a new home directory

-d–m : Specify a new home directory, and move the previous file to the new home directory

- S : Modifies the user's default Shell

- L : Modify User name

                     -L : Lock user accounts

- u : Unlock user account

Chsh : Modify the user shell

CHFN : Modify comment Information

User Password Management

Passwd [Options] USERNAME Modifying user passwords

--stdin: Read password from standard input

-L: Lock user account

-U: Unlock user account

-D: Remove user password

-N: Minimum user password time

-X: Maximum user password usage time

PWCK: Checking user account Integrity

User Group Properties

Groupadd  [Options] GROUPNAME New Group

-G: Specify GID

-R: Added as System group

Groupmod  [Options] GROUPNAME modifying Group Properties

-G: Modify GID

-N: Modify Group name

Groupdel GROUPNAME Deleting a group

gpasswd GROUPNAME Add password to group

Modify file properties

Chown : Modify File owner (Only administrators can use this command)

Chown USERNAME file .... ( change the directory itself only )

-R: Recursive modification (Modify the properties of the directory and internal files)

Chown username:groupname file ..... Change both the owner and the group

Chown USERNAME File ... Change the owner

Chown:groupname file ... change the genus Group

Chgrp : Modify file Group

Chown USERNAME file .... ( change the directory itself only )

-R: Recursive modification (Modify the properties of the directory and internal files)

Modify file Permissions

chmod  MODE file ... Modify the file's user rights

-R: Recursive modification

modify certain permissions for a certain type of user

U: Owner

G: Genus Group

o: Other

A: All

chmod User category =mode file ....

Chmod u=wr,g=w file ....

Chmod uo=wr File ...

Modify a certain bit or some bit permission for a user of a class

Chmod User Category [-/+]mode file










This article from "The world, hard people can be more" blog, please be sure to keep this source http://wangkanglinux.blog.51cto.com/8837012/1685876

Linux 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.