CentOS6 of common commands

Meaning frequently used folders Linux system:

  

  The first: d: represents the directory catalog; -: represents a file; l: represents the connection (similar shortcuts in windows)

  9 later divided into 3 groups, each to a group of three. Representing belong to the Lord's rights, rights of the current user in the same group, other user rights .

  r: Representative readable, r can be represented with the number 4;

  w: Representative writable, may be represented by 2;

  x: executable permissions on behalf of, or be represented by 1.

File directory Linux system introduced

  1. bin: to store binary executable files;
  2. sbin: only root can access;
  3. etc: storage system configuration files;
  4. usr: used to store shared system resources;
  5. home: storage root directory of user files;
  6. dev: device used to store files;
  7. lib: storage of shared libraries and kernel modules;
  8. mnt: Temporary mount point of the file system;
  9. boot: storage of various files used for the system boot;
  10. tmp: temporary files used to store all kinds;
  11. var: a file needs to be changed to store runtime data.

Linux systems commonly used commands are:

  1. cd /: switch to the root directory of the current user;
  2. cd mnt: enter the mnt folder;
  3. cd ../ Returns the current directory of the parent directory;
  4. ll: For more information and list the names of all files in the current directory or folder;
  5. ls: lists the names of all files or folders in the current directory; extension 1: Use ls -a can view all files and directories in the current directory (including hidden files, directories);
  6. ifconfig: View the current ip address:
  7. netstat -an: View the port number occupied ;
  8. ping: communication
  9. mkdir: Create a folder.
  10. mkdir -p aaa / bbb / ccc: this one can create aaa / bbb / ccc three directories, create multi-level directory using the p parameter:
  11. touch zx.txt: Create a file zx.txt;
  12. vim zx.txt: open and edit files zx.txt (press i to switch to insert editable mode, press the esc key to switch to command mode if you want to save the file: Use:: wq (forced to save and exit the program):! q quit it does not save);
  13. yy: Copy (cursor line);
  14. 3yy: Copy line 3 (and below the cursor line three lines total);
  15. p: Paste (cursor location);
  16. dd: Delete (cursor line)
  17. 3dd: Select the cursor you want to delete the following three lines of data; set the number of rows nu settings; set nonu unset the number of rows
  18. w: save
  19. q: quit
  20. q:! to exit without saving changes
  21. x: Save and Exit =: wq  
  22. The first line is positioned to use gg file, to locate a G last line.
  23. Find in command mode, using: s / behalf aa aa for the specified character, using a look - n, using a lookup on N.  
  24. Use: s / aa / bb, a representative of the first character to find replaced aa bb, if you want to replace all, can be used:% s / aa / bb, so that replacement can be carried out globally.
  25. cat zx.txt view files zx.txt; If you see more use more or less: more /usr/src/kernels/2.6.32-573.el6.x86_64/arch/um/Makefile-x86_ 64, less can use the command pageup, pagedown page view.
  26. head -3 zx.txt view the file zx.txt front of the three lines, the default is 10 rows;
  27. See file tail -2 zx.txt zx.txt rearmost row 2, default 10;
  28. find command to find files: find / etc -name '* .conf': Find all named .conf the end of the file in the current directory etc.
  29. rm -f xm.txt current xm.txt delete files in the directory.
  30. rm xyz.txt: delete the specified file, but each will remind really delete? Require a user response. How not prompt when deleting files (r), forced to delete (f)? (Often used): RM -rf xyz.txt Note: rm can not only delete the directory, you can also delete other files or archive, regardless delete any directory or file, are used directly rm-rf directory / file / archive.
  31. pwd: Displays the current directory full path;
  32. Search for files: grep; grep to sudo.conf --color: grep search the contents of the file with to, if you find a color mark.
  33. cp zx.txt zp.txt zx.txt copy files to the directory of the current file, and the file name zp.txt; zx under cp /mnt/wdy/zx.txt / mnt / 9 put / mnt / wdy / directory. txt copied to / mnt / 9, and the file name is not changed. Extended -r: recursive copy: cp - r bb / usr;
  34. View the current process command: ps -ef: Find all the current process linux system. (Sometimes used);
  35. Pipe command: | (very important);
  36. Kill the process: kill. kill -9 25021: 25021 kill process expressed in any case.
  37. Tar.gz compression formats: tar -zcvf demo.tar.gz ./demo the demo file in the root folder compressed into demo.tar.gz.
  38. Unzip way:              tar -zxvf   demo.tar.gz
  39. Access to modify a file or folder: chmod 777 folder or file name
  40. mysql installation begins
  41. Is there mysql version to view Linux system: rpm -qa | grep -i mysql
  42. Use yum command to uninstall:                yum the Remove file names ( continued unloading mysql under the relevant directory   ) yum remove mysql mysql-server mysql -libs mysql-common rm-rf / var / lib / mysql rm /etc/my.cnf
  43. Mysql download source packages. ftp upload it to / usr / local directory, we are centos6.7 corresponding rpm package is: mysql-community-release-el6-5.noarch.rpm
  44. Online install mysql download source: yum localinstall mysql-community-release-el6-5.noarch.rpm
  45. Online install mysql: yum install mysql-community-server
  46. Start mysql service: service mysqld start
  47. Setting up a password to the root user: / usr / bin / mysqladmin -u root password 'new-password'; set a new password for the root account
  48. Remote Connection Authorization: First: cd / usr / bin / re-entering the client: mysql -uroot -p123456; login mysql client after authorization: GRANT ALL PRIVILEGES ON * * TO 'root' @ '%' IDENTIFIED BY '123456. 'WITH GRANT OPTION; remember to refresh permissions: flush privileges; and finally quit quit
  49. CentOS6 temporarily turn off the firewall: service iptables stop; not with the computer system from the start, a modification never change: chkconfig iptables off with caution.
  50. Modify the configuration file, open Linux port of external access rights to add a line 3306; vi / etc / sysconfig / iptables (yy copy and paste p);
  51. Restart Firewall: service iptables start
  52. Check the operation: service iptables status
  53. Refresh the configuration file: source / etc / profile after the restart the service.
  54. mysql end
  55. Configuration environment variable vi / etc / profile add the last line: export JAVA_HOME = / usr / local / jdk1.8.0_171 export (here is wrapping lines) PATH = $ JAVA_HOME / bin: $ PATH
  56. Refresh the configuration file source / etc / profile
  57. Start Tomcat: Start of the bin into the tomcat: ./ startup.sh closed into the bin under tomcat: ./ shutdown.sh use the tail command to view the log.

Guess you like

Origin www.cnblogs.com/in-the-game-of-thrones/p/11442668.html