Maintain some of the commands that Linux must know

Source: Internet
Author: User

lsof (list Open files) is a tool that lists the file opened by the current system. Lsof-i 4 #列举出IP V4 lsof-i TCP lists all TCP network Connections lsof-i lists all network Connections lsof-i:80 #查看一下80端口的进程lsof-i udp:53 #查看 a bit udp,53 Port lsof-u zhangy lists all files opened by a user lsof/usr/sbin/httpd find out who is using a file lsof-p 3738 lists all files opened by a PID-corresponding process Ps-ef #显示所有进程的UID, PPIP , c with stime column PS aux #不区分终端, shows all processes for all users ps-u Hadoop #显示hadoop用户的所有进程uname-a #显示系统信息uname-M #显示系统类型, in general, i386,i686 is a 32-bit system, x86,x86_64 is a 64-bit system uname-s,--kernel-name output kernel name hostname #显示主机名hostname Apple #设置主机名称编辑/etc/sysconfig/ The network permanently sets the hostname mount/dev/sda1/media/usb #挂载u盘mount-L #列出所挂载的系统umount-v/dev/sda1 #通过设备名卸载 and displays detailed procedures cat/proc/ Mounts View Mount disk information Du-ah #详细查看当前目录, subdirectories, all files and directories--max-depth=n output only the totals of the command line parameters that are less than or equal to the nth level of the directory. The--max-depth=0 function is the same as the-s option 
Vmstat Reporting statistics for virtual memory
Vmstat 2 5   #每二秒显示一次系统内存的统计信息, total 5 times

SAR (System activity Reporter report) is one of the most comprehensive systems performance analysis tools available on Linux
Sar-u-O Test 10 3
Note: Samples are sampled every 10 seconds, sampled 3 times in a row, observe CPU usage, and store the sample results in binary form into the file test in the current directory
Sar-q 10 3 Note: Sample every 10 seconds, 3 consecutive samples, monitor process queue length and average load status

Iostat can provide richer IO performance status data iostat-d-K 1 #查看TPS和吞吐量信息The parameter-D indicates that the device (disk) usage status is displayed; k Some columns that use block are forced to use kilobytes; 1 10 indicates that the data display is refreshed every 1 seconds for a total of 10 times


Maintain some of the commands that Linux must know

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.