1. View Disk analysis commands
- DF-HL Viewing disk space remaining
- Df-h viewing the partition size for each root path
- Du-sh [directory Name] Returns the size of the directory
- DU-SM [Folder] Returns the total number of M in this folder
- DF--help See more Features
View the partition of the hard disk #sudo fdisk- l-i/dev/hda -i/dev/sda or #sudo apt-get install Blktool #sudo bl ktool/dev/SDA ID -H #df- H-HS directory name -km/media/usbdisk
2. Resource Usage
top: Main parameter D: Specifies the interval of the update, in seconds. Q: There are no delayed updates. If the user has a superuser, the top command will be executed with the highest precedence. C: Displays the full path and name of the process. S: Cumulative mode, which accumulates the CPU time of a child stroke that has completed or disappeared. S: Safe mode. I: Do not display any idle (idle) or useless (Zombie) travel. N: Displays the number of updates, and when completed will exit to display parameters: PID (Process ID): progress indicator number. User: The username of the process owner. PR: The priority level of the process. NI: The value of the priority level of the process. VIRT: The virtual memory value that the process occupies. RES: The physical memory value that the process occupies. SHR: Shared memory value used by the process. S: The state of the process, where s indicates hibernation, R is running, Z represents a zombie state, and N indicates that the process precedence value is negative. %CPU: The CPU usage that the process consumes. %MEM: The percentage of physical memory and total memory that the process occupies. Time+: The total CPU time that is consumed after the process is started. Command: The start command name of the process startup, and if this line does not appear, the process will have a full command line. Top command "space": Refresh immediately. P: Sort According to CPU usage size. T: Sort by time, cumulative time. Q: Exit the top command. M: Toggles display memory information. T: Toggles display of process and CPU status information. C: Toggle display command name and full command line. M: Sorts according to the size of the memory used. W: Writes current settings to~/the. toprc file. This is the recommended way to write top configuration files. Free1The function free command is used to display memory usage, which is used by all users. 2. Format free [-b-k-m] [-O] [-s delay] [-t] [-v]3The main parameter-b-k-m: Displays memory usage in bytes (KB, MB), respectively. -S delay: Displays the number of seconds per second to show memory usage. -T: Displays the memory sum column. -O: Do not display buffer throttling columns. Uptime -: -: theUp -Min2Users, load average:1.23,1.32,1.21the current time system is running to the current elapsed time by the number of users of the last minute, five minutes, and 15 minutes of system load parameters:-V Displays version information. Vmstatprocs-----------Memory-------------Swap-------io------System------CPU----r b swpd free buff cache si so bi boinchCS US sy ID WA0 1 24980 10792 8296 47316 5 + 205 the 1161 698 - 3 1 -1observing disk activity The disk activity is mainly learned from the following indicators: Bi: Represents the number of blocks read per second from disk (blocks/s). The larger the number, the more activity that reads the disk. Bo: Indicates the number of blocks written to disk per second (blocks/s). The larger the number, the more activity that is written to disk. Wa:cpu the time scale to wait for disk I/O (pending disk IO). The larger the number, the more severe the file system activity is blocking the CPU, because the CPU is waiting for the slow disk system to provide data. WA is ideal for 0. If WA is often greater than 10, the file system may need to be tuned for performance. 2Observing CPU Activity vmstat is more reflective of CPU usage than top: US: The percentage of time the user program uses the CPU. The larger the number, the more busy the user process. SY: The time scale at which the system calls to use the CPU. Note that NFS is running in the kernel, so the CPU time occupied by NFS activity is reflected in the SY. This number is often very large, you need to pay attention to whether a kernel process, such as NFS task is more onerous. If both us and Sy are relatively large, you need to consider separating some of the user programs from the other servers to avoid interaction. ID:CPU the idle time ratio. Wa:cpu the percentage of time to wait for pending disk IO. Iostat used to count CPU usage and TTY devices, hard drives, and CDs-rom's i/0 quantity parameter:-c Show only CPU lines-d displays disk rows-k displays disk output in kilobytes-t include time stamp in output-x include extended disk metrics in the output AVG-CPU:%user%nice%sys%iowait%Idle20.25 0.18 2.61 76.39 0.57%iowait Waiting for local i/o percent of CPU idle time%idle not waiting for local i/o percent of CPU idle time Device:tps blk_read/s blk_wrtn/s Blk_read Blk_wrtnhda9.86 284.34 84.48 685407 2036Number of transfers per second (TPS), 512-byte block reads per second (Blk_read/s), 512-byte block writes per second (BLK_WRTN/S) and 512 byte block reads (Blk_read) and the total number of writes (BLK_WRTN).
Ubuntu View System Resource Usage