Simple basic operation under Linux "for reference"

Source: Internet
Author: User
Tags file copy phpinfo nameserver

Simple basic operation under Linux "for reference"
① Unzip the file command
Tar zxvf filename (filename)
② Viewing modified file contents
VI filename
I enter modify mode
Save Step Esc--shift+:--wq (Save exit Q Direct exit) after modification
③ File Delete command rm
Command format: RM [fir] File or directory
Parameter description:
-F: Force delete
-I: Interactive mode, asking the user whether to operate before deleting
-R: Recursive delete, commonly used in directory deletion
If you delete the File1 file under the/test directory, you can enter the following command:
Rm-i/test/file1
RM-RF FilePath//delete folders and files
RM FilePath//Normal Delete file
⑤mysql Start command
/etc/init.d/mysqld start
⑥ Firewall Modification and configuration
CentOS port usage and firewall port modification http://www.cuiyongzhi.com/index.php/post/50.html
⑦ Find string
If we look for files in the root directory that contain the string "Phpinfo" in all files, we can use the following command.
Find/|xargs grep "Phpinfo"
If we want to find files in the current directory www directory that contain the string "CentOS" content in all files, we can use the following command.
Find www |xargs grep "CentOS"
If we are looking for a file in the current directory www directory to find all the suffixes of the. php file containing the contents of the string "dgdxs.com", we can use the following command.
Find Www-name "*.php" |xargs grep "CentOS"
If we want to find the directory www under there is no http.conf this file. You can use the following command.
Find-name http.conf
⑧ View app process/Kill app Process
Ps-ef|grep Tomcat//Here tomcat can replace the desired app name

Kill-9 Pidnum//pidnum The application process number to kill
⑨ File Copy command CP
Command format: CP [-ADFILPRSU] source file directory (source) destination file directory (destination)
CP [option] source1 source2 source3 ... directory
Parameter description:
-A: Refers to the meaning of archive, but also refers to copying all the directories
-D: If the source file is a connection file, the connection file property is copied instead of the file itself
-F: Mandatory (force), if there are duplicates or other questions, do not ask the user, and force replication
-I: If the target file (destination) already exists, the overwrite will ask if the action is true
-L: Create a hard link connection file instead of copying the file itself
-P: Copy with the properties of the file instead of using the default properties
-R: Recursive replication for directory replication operations
-S: Copy into a symbolic connection file (symbolic link), which is the "shortcut" file
-U: If the target file is older than the source file, update the target file
If you copy file1 from the/test1 directory to the/TEST3 directory and change the file name to File2, you can enter the following command:
Cp/test1/file1/test3/file2
A. File Move command mv
Command format: MV [-FIV] source destination
Parameter description:
-f:force, forcing direct movement without asking
-I: If the target file (destination) already exists, you will be asked to overwrite
-U: Update if the target file already exists and the source file is newer
If you copy file1 from the/test1 directory to the/TEST3 directory and change the file name to File2, you can enter the following command:
Mv/test1/file1/test3/file2
B. Calmly restart the application
Command format: Kill-hup PID//pid for application process number
For example, Kill-hup Nginxpid, is to tell Nginx, calmly restart Nginx, we generally use this signal to restart Nginx, or reload the configuration, because it is calmly restarted, so the service is uninterrupted!
C.dns Configuration Modifications
#vi/etc/resolv.conf
Modify the DNS address to the following
NameServer 114.114.114.114
NameServer 8.8.4.4
NameServer 8.8.8.8
Unless indicated, otherwise the article by Cui uses the blog to organize the release, welcome reprint.
Reprint please indicate this article address: Http://www.cuiyongzhi.com/post/CentOS under the simple command note "for reference". html
If you like, you can click here to subscribe to this site

Simple basic operation under Linux "for reference"

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.