Note--linux command

Source: Internet
Author: User

//linux View End Share populationPs-aux | grep <text>
Netstat–apn

//Kill processKill-9 <PID>
//System encoding settings (GBK, UTF-8)Locale View encoding settings if you are unable to run Locale-gen, run the following command Apt-get purge localesapt-get autocleanapt-get install locales
Modify the default Chinese encoding character: Vi/etc/profileexport lc_all= "ZH_CN. GBK "Export lang=" ZH_CN. GBK "Export language=" Zh_CN:zh:en_US:en " or vi/etc/environmentlang= "ZH_CN. GBK "language=" Zh_CN:zh:en_US:en "
Add character encoding: 1. Use Locale-gen Locale-gen ZH_CN directly. GBK2. Modify the/var/lib/locales/supported.d/local file to add the Chinese character set at the end of the file Zh_cn GBK save dpkg-reconfigure locales restart after exiting
//Firewall port mappingIptables-t nat-a prerouting-p tcp--dport 80-j REDIRECT--to-port 8080

//user and user group managementUser-related profiles:/etc/passwd Note: User profile;/etc/shadow Note: User shadow password file;
Profiles related to user groups:/etc/group Note: User group profile;/etc/gshadow Note: Shadow files for user groups (group);
$ sudo useradd - g DDC [User name] #-- ------------Add a new user $ sudo passwd [user name] #--------------Create a password for a new user $ sudo usermod -g ddcuser [用户名] #--------------将新用户改为ddcuser组 #新用户修改自己的密码: $ passwd User Management
  
 
  1. useradd //添加用户
  2. adduser //添加用户
  3. passwd //为用户设置密码
  4. usermod //修改用户信息
  5. pwcov //同步用户从/etc/passwd到/etc/shadow
  6. pwuncov //pwcov逆操作
User Group Management
 
   
  
  1. groupadd //添加用户组
  2. groupdel //删除用户组
  3. groupmod //修改用户组信息
  4. groups //显示用户所属用户组
  5. grpcov //同步用户组从/etc/group到/etc/gshadow
Rights Management
 $ sudo chmod 755 [folder] Read permission for 4 Write permission for 2 run permission for 1 755 in the first 7 for file owner permissions 7=4+2+1 (RWX) The second 5 is the permissions of the same group of users 5=4+1 (R-x) The third 5 is the permissions of other users 5=4+1 (r-x)  
 
   
  
  1. chmod //更改文件权限信息
  2. chown //更改文件拥有者
  3. chgrp //更改文件所属用户组



Note--linux command

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.