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
- bin: to store binary executable files;
- sbin: only root can access;
- etc: storage system configuration files;
- usr: used to store shared system resources;
- home: storage root directory of user files;
- dev: device used to store files;
- lib: storage of shared libraries and kernel modules;
- mnt: Temporary mount point of the file system;
- boot: storage of various files used for the system boot;
- tmp: temporary files used to store all kinds;
- var: a file needs to be changed to store runtime data.
Linux systems commonly used commands are:
- cd /: switch to the root directory of the current user;
- cd mnt: enter the mnt folder;
- cd ../ Returns the current directory of the parent directory;
- ll: For more information and list the names of all files in the current directory or folder;
- 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);
- ifconfig: View the current ip address:
- netstat -an: View the port number occupied ;
- ping: communication
- mkdir: Create a folder.
- mkdir -p aaa / bbb / ccc: this one can create aaa / bbb / ccc three directories, create multi-level directory using the p parameter:
- touch zx.txt: Create a file zx.txt;
- 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);
- yy: Copy (cursor line);
- 3yy: Copy line 3 (and below the cursor line three lines total);
- p: Paste (cursor location);
- dd: Delete (cursor line)
- 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
- w: save
- q: quit
- q:! to exit without saving changes
- x: Save and Exit =: wq
- The first line is positioned to use gg file, to locate a G last line.
- Find in command mode, using: s / behalf aa aa for the specified character, using a look - n, using a lookup on N.
- 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.
- 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.
- head -3 zx.txt view the file zx.txt front of the three lines, the default is 10 rows;
- See file tail -2 zx.txt zx.txt rearmost row 2, default 10;
- find command to find files: find / etc -name '* .conf': Find all named .conf the end of the file in the current directory etc.
- rm -f xm.txt current xm.txt delete files in the directory.
- 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.
- pwd: Displays the current directory full path;
- Search for files: grep; grep to sudo.conf --color: grep search the contents of the file with to, if you find a color mark.
- 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;
- View the current process command: ps -ef: Find all the current process linux system. (Sometimes used);
- Pipe command: | (very important);
- Kill the process: kill. kill -9 25021: 25021 kill process expressed in any case.
- Tar.gz compression formats: tar -zcvf demo.tar.gz ./demo the demo file in the root folder compressed into demo.tar.gz.
- Unzip way: tar -zxvf demo.tar.gz
- Access to modify a file or folder: chmod 777 folder or file name
- mysql installation begins
- Is there mysql version to view Linux system: rpm -qa | grep -i mysql
- 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
- 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
- Online install mysql download source: yum localinstall mysql-community-release-el6-5.noarch.rpm
- Online install mysql: yum install mysql-community-server
- Start mysql service: service mysqld start
- Setting up a password to the root user: / usr / bin / mysqladmin -u root password 'new-password'; set a new password for the root account
- 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
- 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.
- 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);
- Restart Firewall: service iptables start
- Check the operation: service iptables status
- Refresh the configuration file: source / etc / profile after the restart the service.
- mysql end
- 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
- Refresh the configuration file source / etc / profile
- 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.