Common Linux Commands

Source: Internet
Author: User
Some commonly used Linux commands 1. change the password: passwd username www.2cto. com2, download jdk-6u25-linux-i586.bin3, run (cd into a directory after/usr/jdk-6u25-linux-i586.bin decompression operation) shjdk-6u25-linux-i586. B... work commonly used Linux Command 1, modify the password: passwd username www.2cto.com 2, download jdk-6u25-linux-i586.bin 3, run (cd to enter a directory,/usr/jdk-6u25-linux-i586.bin decompression operation) sh jdk-6u25-linux-i586.bin 4. change the environment variable vi in The opadmin home directory. bash_profile www.2cto.com: Edit the files in the user's home directory. bash_profile to add the following content: expor T JAVA_HOME =/usr/java/jdk1.5.0 _ 10 export PATH = $ PATH: $ HOME/bin: $ JAVA_HOME/jre/bin export CLASSPATH =.: $ JAVA_HOME/jre/lib/rt. jar: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar remarks: Linux. bash_profile, bash_logout ,. the three bashrc files have special significance for bash. You can modify these three files to enable the system to automatically set the personalized environment for your account. These files may exist in your home directory. if they do not exist, the system will configure them according to the/etc/profile file. 5. set the soft link: ln-s 6. view the total disk space: df-h 7. display the disk space occupied by folders in the home directory: du-sh (example: du-sh/home/*) 8: vi related operations: shift + g to the last line gg to the first line: wq save and exit: q! Force exit:/keyword query by keyword from the current file, the next keyword is N 9, the file is obtained from the network: wget 10, show all files (including hidden files ): ls-a 11. only hide files: l. 12. display the files in the current folder: ll or ls 13. modify the saved svn user password and clear the files in the following Directory:/home/opadmin /. subversion/auth/14. delete the file: rm-rf 15. copy the file: cp 16. rename the file: mv 17. set (add) the Gateway address: route add default gw 128.1.1.11 dev eth0 18. modify the Gateway address as follows (1) vi/etc/sysconfig/network (2: geteway = gateway ip (3) save and exit: wq 19, view and set the system time: (1) view: date (2) set: date: 1129212420 11.29 format: date Month Day hour year. second 20, nohup command: nohup command, for example, we have a start. sh needs to run in the background, and you want to continue running in the background, use nohup, for example: (1) nohup/root/start. sh & (full path can be written) (2) or nohup. /start. sh & (can be written. /) after executing the preceding command, press enter in shell and prompt: [~] $ Appending output to nohup. out 21. View process: ps view java process: ps-ef | grep java kill process-9 22. view the IP address: ifconfig. if the command is not displayed, try to use the root user or run the following command: /sbin/ifconfig 23. to upload a file under the Directory to ftp, perform the following steps: (1) first enter the Directory of the file to be uploaded, for example: cd/home/opadmin/irp/target (2) ftp address (3) enter the user name and password (4) put irp.zip 24. add a project to be modified as follows: (1): pom file of irp-application-main (2): pom file of irp-application-ear (3): modify releaseconf on 95. xml 25, restart Command: (1), reboot (2), shutdown-r now restart immediately (for root users) (3) shutdown-r restarts automatically after 10 minutes (for root users) (4) and shutdown-r at (for root users) if you use the shutdown command to set the restart, you can use the shutdown-c command to cancel the restart Command: (1), halt immediately shut down (2), poweroff immediately shut down (3) shutdown-h now shut down immediately (used by the root user) (4), shutdown-h shut down automatically 10 minutes later if shutdown is set through the shutdown command, you can use the shutdown-c command to cancel the restart 26, set the java environment variable (available for all users) to open vi/etc/profile, and add the following at the end: export JAVA_HOME =/usr/jdk/export PATH = $ JAVA_HOME/bin: $ PATH export CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. jar: $ CLASSPATH 27. check the current port usage. netstat-ntlp 28. add a port to the firewall to solve the problem of application access failure. vi/etc/sysconfig/iptables (add a port: for example: -A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 8980-j ACCEPT) service iptables restart 29, view memory usage (1) free: memory usage of the current machine (2) top: memory usage of each process. shift + m can be used for sorting. 30. kill process: kill-9. 31. View JVM heap usage: jmap-heap pid 32. check GC status: jstat-gcutil pid 1000 1000 33. dump the current memory snapshot: jmap-dump: format = B, file =/home/longhao/heamdump. out 34. delete a row of files opened with vi: dd 35. find/search File: find/-name *. docx (search for files with docx extension from the root path)

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.