under the use of Linux/unix, often using the text interface to set up the system or operating system, the author himself in the process of work is also in constant contact with this command, so for This special brewing, preparation, began the writing of this article. This paper mainly records some of their usual linux/unix under the operation of commands, record and collation, one can deepen the image, two can record sharing. I hope you crossing, for inappropriate or ambiguous places, give the specified and explain, in order to learn and improve together.
"Reproduced use, please specify the source: http://blog.csdn.net/mahoking "
004 Linux mkdir command [make directory]
1 command format
mkdir [Options] [contents] format mkdir [option] [directory]
2 command functions
The mkdir command enables you to create a folder or directory named in directory at the specified location. The user who creates the folder or directory must have write permissions to the parent folder of the folder that is created. Also, the folder (directory) You create cannot have the same name as the filename in its parent directory (that is, the parent folder), that is, the same directory cannot have the same name (case sensitive).
3 Common examples
Example 01
Command: Mkdir/home/selfdir
Input:
[Email protected] root]# Mkdir/home/selfdir
Description
No
Example 02
Command: Mkdir-m 777/home/selfdir
Input:
[Email protected] root]# mkdir–m 777/home/selfdir
Description
Create a directory with permissions of 777.
-M,--mode= mode, set permissions < mode > (similar to chmod) instead of rwxrwxrwx minus Umask
-P,--parents can be a path name. In this case, if some directories in the path do not already exist, and with this option, the system will automatically establish those that do not already exist, that is, multiple directories can be established at one time;
-V,--verbose displays information each time a new directory is created
--HELP Display this help message and exit
--version output version information and exit
005 Linux groupadd Command
1 command format
Groupadd [Options] [user Group] format groupadd [option] [group]
2 command functions
The Groupadd command is used to create a new user group.
3 Common examples
Example 01
Command: Groupadd selfgroup
Input:
[Email protected] root]# Groupadd Selfgroup
Description
No
006 Linux Groupdel Command
1 command format
Groupdel [Options] [user Group] Format del [option] [group]
2 command functions
The Groupdel command is used to delete a user group that already exists.
3 Common examples
Example 01
Command: Groupdel selfgroup
Input:
[Email protected] root]# Groupdel Selfgroup
Description
If a user in any group is on-line, the user group cannot be removed, so if a user is online, it is best to move the user out of the group and then delete the user.
007 Linux useradd Command
1 command format
useradd [Options] [users] format useradd [option] [user]
2 command functions
The Useradd command (also available with adduser) is used to create a new user account.
3 Common examples
Example 01
Command: useradd-d/home/testdir-g test-m testuser
Input:
[Email protected] root]# useradd-d/home/testdir-g test-m testuser
Description
-D Set the login directory for the new user
-G to add new users to the group
-M user directory is automatically created if it does not exist
008 Linux Userdel Command
1 command format
Userdel [Options] [users] format userdel [option] [user]
2 command functions
The Userdel command is used to delete existing users and related documents.
3 Common examples
Example 01
Command: Userdel–r testuser
Input:
[Email protected] root]# userdel–r testuser
Description
-R deletes the document in the user directory. Documents in other locations are also identified and deleted.
Userdel is not allowed to remove user accounts that are online, so if you want to delete such user accounts, you must first kill the user on the system to run the program in order to delete the account.
Second, the Linux operation command accumulates "mkdir, Groupadd, Groupdel, Useradd, Userdel"