linux production environments deploying common operations command

First, users and user groups

  1. groups: group members to view the currently logged in user
  2.  groups user: View user group is located, as well as members of the group
  3.  whoami: View the current logged-on user name
  4.  whois: find and display user information.
  5.  who: displays the current logged in user information. 
  6.  / Etc / passwd: can directly view the file, view all user information

 New user groups and user information need root privileges

  1. group: User Groups
  2.  group -G group name
  3.  groupdel group name (Delete User Group)
  4.   useradd: user
  5.  useradd -d username -g user group (-d home directory of the same name generated for the user, the user packets added -g)
  6.  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)
  7.   su - user name (user switch)
  8. passpwd: Change Password
  9.  passpwd user name (specified user to modify the password)
  10.  Note: After you add users, change passwords available passpwd directly, but suggested adding a user name
  11.  userdel username (delete user) 
  12. chown: Change file owner and group
  13.   chown mail: mail file or directory
  14.   chmod: File Permissions
  15.   chmod 777 file name or folder

Second, the configuration jdk

  1. java -version: Check the current version jdk
  2.   echo $ JAVA_HOME: View JAVA_HOME path
  3.   which java: View the current path jdk
  4.  ls -al: execute this command in your home directory, show all hidden files
  5.  
  6. vi ~ / .bash_profile: modify the file, JDK configuration, as shown below (the presence of the JAVA_HOME configuration has JDK)
  7. 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

    1. vi /etc/security/limits.conf: Open the configuration file (two in front of the user's home directory)
    2.  Commonly located:
    3.  Username soft nproc 10240
    4.  Username hard nproc 16384 
    5. Username soft nofile 10240
    6.  Username hard nofile 65536
    7.  
    8. . .Limits.conf or source .limits.conf: reread the configuration file, otherwise the changes will not take effect

 

 

    1. hard indicates the maximum amount set in the system can
    2.  Limit soft limit can not be higher than the har
    3.  With - on show at the same time it sets the value of soft and hard.
    4. core - core file size limit
    5.   date - maximum data size
    6.  fsize - Maximum file size
    7.  memlock - the maximum locked memory address space
    8.  The maximum number of open files - nofile
    9.  rss - maximum perm size settings
    10.  stack - the maximum stack size
    11.  cpu - in minutes of the most CPU time
    12.  The maximum number of processes - noproc
    13.   as - address space limit
    14.  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

 

Guess you like

Origin www.cnblogs.com/xiaozengzeng/p/12483982.html