Collect and organize common linux shell commands

Source: Internet
Author: User
Tags linux shell commands
Collect and organize common liunx shell commands 1. View database cache [plain] showstatuslike & amp; #39; Qca % & amp; #39; showstatuslike & amp; #39; com_sel % & amp; #39; data table repair [plain] myisamchk-rmmc_user
Collect and organize common linux shell commands 1. View database cache [plain] show status like 'qca % '; show status like 'com _ sel %' on www.2cto.com '; [plain] myisamchk-r mmc_user_info_20070120.MYI database process [plain] show processlist firewall view [plain] iptables-nL 60028 II. server-related www.2cto.com server connections view [plain] netstat-an | grep-c ": 3360 "querying mysql database connections netstat-an | grep ". 80 "| wc-l: view the number of online users ps-ef | grep http | wc-l: view apache concurrency netstat-anp | grep 80 | wc netstat-anp | grep 80 | grep EST | wc-l netstat-an | awk '/: 80/{print $5} '| awk-F ": "'{print $1}' | sort | uniq-c | sort-n netstat-nap | grep mysql netstat-n | awk '/^ tcp/{++ S [$ NF]} END {for (a in S) print, S [a]} '[plain] // view server time uptime // Set date-s 2012 | 1 | 2 // Set date-s 18:30:50 // synchronization time/ usr/sbin/ntpdate stdtime.gov.hk view server information [plain] // view Linux version information uname-a cat/proc/version cat/etc/issue lsb_release-a // view CPU information more /proc/cpuinfo // view the CPU model and number of logical cores cat/proc/cpuinfo | grep name | cut-f2-d: | uniq-c // number of CPU running bits getconf LONG_BIT // number of physical CPUs cat/proc/cpuinfo | grep physical | uniq-c // view memory information more/proce/meminfo/ /view the full hardware information dmidecode // view the server model dmidecode | grep "Product Name" // number of processes pstree // add the priority level of process 180 to 1 renice + 1 180 // terminate a PID process kill-9 PID // specify to execute/bin/ls at 5 + 3 days/bin/ls scheduled task [plain] after three days minute Hour day month week command or script 01 1-3/2 ***. sh // write the command directly to the cyclic task echo "40 7 *** 2/root/sh">/var/spool/cron/root www.2cto.com // view the crontab of the automatic periodic task- l // delete the automatic cycle task crontab-r // whether A port netstat-anlp is enabled | common instance of grep port [plain] // allow access to the specified port iptables-a input from the IP address -s 192.168.62.1-p tcp -- dport 22-j ACCEPT // disable the use of A port iptables-a input-p tcp -- dport 22-j DROP iptables-a input-p tcp -- dport 31-j REJECT [plain] // disable the QQ Port iptables-d forward-p udp -- dport 8000-j REJECT // disable the icmp port # except 192.168.62.1, prohibit others from pinging my host iptables-a input-I eth0-s 192.168.62.1/32-p icmp-m icmp -- icmp-type 8-j ACCEPT iptables-a input-I eth0 -p icmp-m icmp -- icmp-type 8-j DROP service management [plain] # start sendmail service/etc/init. d/sendmail start // view the startup status of all services chkconfig -- list // view the startup status of a service chkconfig -- list | grep httpd // start and shut down the service connection/etc /rc. d/rc3.d/S55sshd # S boot start K shutdown stop 55 level followed by service name ln-s-f/usr/local/httpd/bin/apachectl/etc/rc. d/rc3.d/S15httpd
Related Article

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.