1. Summary of personal use
1. Query Linux version cat/proc/version 2. Query Linux Information uname-a 3. Create folders mkdir folder 4. Create a file Touch Test.java 5. View Files
VI Test.java 6. Modify the file into the VI editor, enter I, enter the edit (insert) mode, edit, Esc key back to the VI Editor Command mode 7.VI exit command line mode input: Q,q!,:wq,:x can exit VI : W Save: W filename Save As filename:wq! Save and exit: Wq!filename to file filename save after exit: q!
Do not save direct exit: X Save and exit <== equivalent to ==>: wq!
8. View this machine ip:ifconfig 9*. Operation Tomcat installation tomcat:1. Download apache-tomcat-6.0.20.tar.gz 2. Installation (decompression) TAR-ZXVF apache-tomcat-6.0.20.tar.gz find the Bin directory under Tomcat: CD/SHARE/APACHE-TOMC At-7.0.55/bin start tomcat:./startup.sh shut down Tomcat:./shutdown.sh 10. Windows-like term Service Manager: Top-c view Java process: Ps-ef |grep java kill the corresponding ID process: kill-9 PID kill PID: Kill process, PID from
Top-c execution get (PID for process number), note before running remember to check the process number. 11. Delete File: RM filename Delete folder: RM-RF directory name-R is recursive down, no matter how many levels of directory, delete-F is directly forcibly deleted without any hint of meaning 12. View installed software: Rpm-qa|grep software name view installed JDK Rpm-qa|grep jdk 13.Linux shutdown and reboot Shut down immediately: halt or Shutdown-h now or poweroff 10 minutes after shutdown: shutdown-h 10 reboot: Reboot reboot immediately (root): shutdown-r n ow 10-minute automatic reboot: shutdown-r 10 20:25 reboot: Shutdown-r 20:25 14. View the installation path for JDK: RPM-QL JDK *.
Linux install jdk:1. Download the Linux version of the JDK and copy it to the server's specified directory 2. Locate the rpm file for JDK and install JDK:RPM-IVH jdk-7u67-linux-x64.rpm [Root@localhost java]# RPM-IVH jdk-7u67-linux-x64.rpm preparing ... #################
########################## [100%] 1:jdk ########################################### [100%] Unpacking JAR files ... rt.jar ... jsse.jar ... charsets.jar tools.jar ... localedata..
Jar ... jfxrt.jar ... Note: The default installation to:/usr/java/jdk1.7.0_67 *.
Linux configuration Java Environment variables: 1. Find the profile file under/etc cd/etc 2. Modify this file, VI profile Find export line, add or modify as: Export Path=/usr/java/jdk1.7.0_67/bin: $PATH export java_home=/usr/java/jdk1.7.0_67
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar Note: The/usr/java/jdk1.7.0_67 here is the JDK installation path 3. After exiting the login or reboot, check the success through Java-version *. Linux uninstall jdk:1. View the installed JDK rpm-qa|grep JDK [root@localhost java]# rpm-qa|grep JDK java-1.6.0-openjdk -1.6.0.0-1.41.1.10.4.el6.x86_64 jdk-1.7.0_67-fcs.x86_64 2. Select the JDK to uninstall---Here's an example of uninstalling 1.7 jdk rpm-e jdk-1.7.0_ 67-FCS.X86_64 Note: Uninstall the other installed JDK directly with Rpm-e <javaXXXXX> Uninstall the rpm version of JDK: #rpm-qa|grep JDK display: JDK-1.6.0_10-FC S uninstall: #rpm-e--nodeps Jdk-1.6.0_10-fcs linux common commands: 1. View computer name hostname 2. View environment variable env 3. View memory usage and swap area usage free-m 4. View the specified directory size du-sh < directory name > 5. View total memory and idle amount grep memtotal/proc/meminfo grep Memfree/proc/meminfo 6. View system run time, number of users, load uptime 7. View network interfaces and IP ifconfig 8. View all Processes Ps-ef 9.Real-time display of process status Top 10. View the active user W 11. View the specified user information ID < user name > 12. View user logon log last 13. View all installed packages RPM-QA
2. Common Commands 1. Under Compose Bar, you can operate on multiple servers at the same time. Select to all Sessions 2. View Java processes: Ps-ef | grep java PS auxf | grep java 3. Kill Java Process: Pkill Java (can be used when drag change, kill all Java processes) kill-9 process ID Ps-ef | grep "Dcatalina.base=/usr/oa/appserver" | Grep-v "grep" | awk ' {print $} ' | Xargs kill-9 4. catalog view and Execute program: Cd/usr/oa/bin (enter project directory) CD. (Back to a directory)./startup.sh ./stop.sh (execute files under current directory) 5. Go to a user su root (switch to root) 6. View Directory: ll (show directory details) LS (all files under the display directory) 7. Modify the contents of the file under Linux 1 Choose VI to select the file VI index.jsp 2 to be modified and then appear the prompt content click I to modify 3) after the change is done press ESC and then press the shift+ colon last input Wq 8. See if the hard drive is full df-h 9. Delete files (used when clearing cache) 1. View file directory: Pwd 2. Delete File: Rm-rf folder directory 10. Copy file CP -r /user/oa &nbs P;/usr_back_oa 11. View Log tail-r catalina.out tail-n catalina.out 12. View File Cat filename.xml 13. View IP, turn on remote connection Service ifconfig -View IP address, note this is the IF start instead of IP service sshd status --View the status of the Sshd service sshd start &nbsP --Start the status of the sshd service chkconfig--list chkconfig--list | grep sshd View Enable Services 14. Lists the number of open files for each process Lsof-n|awk ' {print $} ' |sort|uniq-c |sort-nr|more directly statistics the number of Java process connections ps-ef| grep java | awk ' {print $} ' | awk ' Nr==1 ' | Xargs Lsof-p | Wc-l 15. First Use Ps-ef|grep Java view, and then view 12120 of the open quantity lsof-p 12120 |wc-l 16. For Tomcat authorization, not less sudo,username for user name sudo chown- R Username/users/username/documents/tomcat
3. Knowledge that must be and remains to be mastered
First, Linux basic commands
1, User management
Userdel Delete user account
Useradd Add user account
SU changes the ID of the current user
2. File Directory Management
LS Browse the directory, view the current directory of files and file names
chmod Modify File Permissions
Chown Change file Owner
CP Copy Files
CD Change current directory
MV Rename a file or move a file
RM Delete files or directories
PWD current Directory
SCP Remote Copy
Alias aliases
3. Other Orders
ln creates a link between the files
Tail output file content after the section, generally we will be through the tail-f real-time view of the current program print logs.
Type to see the path where a command is located
WC View number of rows
grep finds in file contents
Find finding files
Date View Dates
Crontab make planning tasks, usually for system monitoring.
DF to view the disk space, you'd better write a script to monitor the disk space in crontab. More than 90% to send email to the relevant personnel.
PS View process Status
Top View CPU Usage
Kill Terminate Process
Killall Java programmers most like to use killall-9 Java Bar
W View the logged in user and what they are doing, or look at the system's load. Load is too high, you should look for the reason.
Who view the current user's bento situation
Tar unzip or compress files
Echo Console output
wget HTTP Access
RPM RPM Package Management
4, redirect, pipeline
5, standard output, standard error
6, using/shielding the meaning of a special character
7, Regular expression
Second, master Vim editor.
Third, the LIUNX environment under the shell script, the Perl script writes
In order to manage Web server applications, it is often necessary to write some scripts.
The script is written to focus on the following points:
1. Understand the meaning of double quotes, single quotes, and inverted quotes.
2, the use of backslashes.
3, the Shell script assignment statement to the left of the variable name does not add $, often write Perl scripts often make this error.
4, long string, with space, as a parameter of the script error, enclose the string in double quotes.
5. Have a good command of the use of awk and sed.
Iv. installation of basic software packages
Apache, resin, MySQL
The general steps are:
Configure
Make
Make install