First, users and user groups
-
groups: group members to view the currently logged in user
-
groups user: View user group is located, as well as members of the group
-
whoami: View the current logged-on user name
-
whois: find and display user information.
-
who: displays the current logged in user information.
-
/ Etc / passwd: can directly view the file, view all user information
New user groups and user information need root privileges
-
group: User Groups
-
group -G group name
-
groupdel group name (Delete User Group)
-
useradd: user
-
useradd -d username -g user group (-d home directory of the same name generated for the user, the user packets added -g)
-
useradd -d username -g user group 1 -G user group 2, user group 3 (under simultaneous users 1, 2, 3, wherein group 1 based group)
-
su - user name (user switch)
-
passpwd: Change Password
-
passpwd user name (specified user to modify the password)
-
Note: After you add users, change passwords available passpwd directly, but suggested adding a user name
-
userdel username (delete user)
-
chown: Change file owner and group
-
chown mail: mail file or directory
-
chmod: File Permissions
-
chmod 777 file name or folder
Second, the configuration jdk
-
java -version: Check the current version jdk
-
echo $ JAVA_HOME: View JAVA_HOME path
-
which java: View the current path jdk
-
ls -al: execute this command in your home directory, show all hidden files
-
-
vi ~ / .bash_profile: modify the file, JDK configuration, as shown below (the presence of the JAVA_HOME configuration has JDK)
-
bash_profile or source .bash_profile: reread the configuration file, otherwise the changes will not take effect
Third, the configuration session permissions
Users can configure the number of open file information, such as number of processes
-
vi /etc/security/limits.conf: Open the configuration file (two in front of the user's home directory)
-
Commonly located:
-
Username soft nproc 10240
-
Username hard nproc 16384
-
Username soft nofile 10240
-
Username hard nofile 65536
-
-
. .Limits.conf or source .limits.conf: reread the configuration file, otherwise the changes will not take effect
-
hard indicates the maximum amount set in the system can
-
Limit soft limit can not be higher than the har
-
With - on show at the same time it sets the value of soft and hard.
-
core - core file size limit
-
date - maximum data size
-
fsize - Maximum file size
-
memlock - the maximum locked memory address space
-
The maximum number of open files - nofile
-
rss - maximum perm size settings
-
stack - the maximum stack size
-
cpu - in minutes of the most CPU time
-
The maximum number of processes - noproc
-
as - address space limit
-
This allows the maximum number of users logged on - maxlogins
Fourth, the application uploads
Archive: tar - czvf .tar.gz package name folder Decompression: tar - xzvf package name .tar.gz 1 , access to files from other servers SFTP - Pport username @ address of the target server get compressed file name exit: exit sftp mode 2, using ftp / sftp tool
edit:
ls - rtl: pwd: Get the current directory echo > file name: Clear file contents RM -rf File name: delete folders and files (* on behalf of all, may represent parts such as * .log) cp - R copy the file name of the target address: Copy file netstart the -lp | grep Port Number: Check the port occupancy lsof - i: Port: View Port occupation df the -sm or df - H: Check disk space top: cpu usage Free - m: CPU usage vi editor: set ff:? View the current file encoding format FF SET = unix: modifying the current file format is encoded unix ? : Look Up / : Look down n: Find what you traverse down set nu: show line numbers Line number: The cursor jumps only goal line G: Skip to end of file