Linux common commands update ...


1. Telnet host
ssh hostname @ip
2. View server ip information
ifconfig
ip addr
3./opt / root / home / var Meaning
 / opt large software store directory
 / root privileged user directory
 / home general user directory
 / var store frequently change file
4. Create a folder and on the parent directory
 mkdir filename
 mkdir -p parent folder / subfolder
5. Check the contents of the current folder
 LS
6. Check the folder where the absolute path
 pwd
7. Create a text
 touch filename
8. Delete command
 rm -f file
 rm -rf folder / file
9. Change directory command
 cd folder path
10. Print command string
 echo string
11. The text editor
 Vim / VI
12. The view the file contents are several commands
 cat filename
 more file name
13 covering the output redirection operator
 >
14. append output redirection operator
 >>
15. recursively copy the folder
 cp -r folder new path
16. the moving files, folders
 mv file / folder
17. Find command
 find is to find the name of the folder parameters
 -name find files by file name
 -type find a certain type of file, such as :
 B - block device file.
 d - directory.
 c - a character device file.
 p - pipe file.
 l - a symbolic link file.
 f - regular file.
 s - socket file
18. A pipe symbol
 input will command two separated pipe character command on the left as the right side commands will output pipe symbol | "."
19. The remote file transfer command
 scp you want to transfer content you want to transfer to the place
20. Statistics File Size command
 du -sh file
21.linux Task Manager command
 Top
22.linux shutdown command
 poweroff to shut down the system
 reboot for reboot machine
23. View user identity information command
 whoami
24. The create user
 useradd username
25. delete users and their home directory
userdel -rf user name
26. The user switches
 su - username
27. execute commands as root
 with the root user
  visudo / etc / sudoers
  write
  ## the allow root to the any RUN commands Anywhere
 root ALL = (ALL) ALL
 chaoge ALL = (ALL) ALL # allow chaoge anywhere, execute any command
 
   Switch to chaoge user
    SU - chaoge
    the sudo command
 
28. Change the file permissions command
 chmod [identity] [parameters] [file]
   U (the User) + (add)
   G (Group) - (minus)
   O (OTHER) = (assignment)
   A (All)
29 commands modify the file owner
 chown owner name file
30. The flexible connection command
 ln -s software to connect the target file name
31. The package file command and its parameters
 tar -zcvf .tar.gz packaged file compressed file
32. unpack command and its parameters
 tar -zxvf package file .tar. gz -C target path
33. View linux port
 netstat -tunlp
34. the check process
 PS -ef
35. the process of killing
  1. ps -ef | grep to find the process number pid
  2. kill the process via kill pid
 
   Batch kill process
   task to kill pkill name of
 
36. The system of service management command
 systemctl start foo.service start the service
 systemctl restart foo.service restart the service
 systemctl stop foo.service stop service
 systemctl reload foo.service reload the configuration file (not termination of service)
 systemctl Status foo.service check the service status
 systemctl enable foo.service at startup
 systemctl disable foo.service boot does not start automatically
 systemctl is-enabled foo.service to see whether a particular service to start automatically turn
37. Check the remaining amount of disk space
 df -h
38. The dns resolve command
 configuration file
 cat / etc / resolv.conf
 #dns server address
 nameserver 119.29.29.29
 nameserver 223.5.5.5

   Specify local parsing:
    / etc / hosts
    host IP host name of the host alias
    127.0.0.1 www.pyyuc.cn
   nslookup www.oldboyedu.com
 
39. The package management command
 rpm:
  Install the software format of the command rpm -ivh filename.rpm # i represents the installation process h v display detailed progress bar to display
 the software upgrade command format rpm -Uvh filename.rpm
 uninstall the software's format command rpm - e filename.rpm
 query software command format description information rpm -qpi filename.rpm
 software file format information listed in the command rpm -qpl filename.rpm
 command format files belong to which query RPM -qf filename of the RPM
  
   yum:
   yum repolist All lists All warehouse
   yum list all listed warehouse all packages
   yum info package name to view package information
   yum install package names package install
   yum reinstall reinstall package names package
   yum update package names upgrade packages
   yum remove package names removing packages
   yum clean all clear all caches warehouse
   yum check-update check can update packages
   package yum grouplist view the system already installed
   yum groupinstall package groups to install the package group
 
40. Virtual Environment Tool Command
 installation
  pip3 install virtualenvwrapper
 settings are loaded every time you start
  to open the file
 vim ~ / .bashrc
 write the following two lines of code
 export WORKON_HOME = ~ / Envs # virtualenv set of unified management directory
 export VIRTUALENVWRAPPER_VIRTUALENV_ARGS = '- no- site-packages' # virtualenvwrapper add parameters to generate a clean environment isolated
 export VIRTUALENVWRAPPER_PYTHON = / opt / python347 / bin / python3 # specify the python interpreter
 source /opt/python34/bin/virtualenvwrapper.sh # virtualenvwrapper installation script executed
 to read the file so that the entry into force, then you can already use virtalenvwrapper
 Source ~ / .bashrc
 basic instructions:
  create: mkvirtualenv virtual environment name
  switch: workon virtual environment name
  stop: deactivate 
  delete: rmvirtualenv virtual environment name
 other instructions:
  List all environmental isvirtualenv
  navigate to the directory cdvirtualenv virtual environment
  into the site-packages directory cdsitepackages
  display the contents of site-packages directory issitepackages
 

Guess you like

Origin www.cnblogs.com/wangm-0824/p/11723618.html