System Management commands required by Linux System Engineers (1)

Source: Internet
Author: User

For Linux systems, whether it is a central processor, memory, disk drive, keyboard, mouse, or user, it is a file. Linux system management commands are the core of its normal operation. After familiarizing yourself with common Linux File Processing commands, This section describes the commands for managing systems and users.

Df

1. Role

The df command is used to check disk space usage of the file system. The permission is granted to all users.

2. Format

Df [options]

3. Main Parameter-s: only the total number of data blocks occupied by each Names parameter. -A: recursively displays the number of data blocks occupied by each file in a specified directory and Its subdirectories. If neither-s nor-a is specified, only the disk blocks occupied by each directory and Its subdirectories in Names are displayed. -K: Used to list disk space usage in 1024 bytes. -X: Skipping directories on different file systems is not counted. -L: calculates the size of all files, and computes hard-linked files multiple times. -I: displays inode information instead of block usage. -H: print out the file system size in an understandable format, such as 136KB, 254 MB, and 21 GB. -P: Use the POSIX output format. -T: displays the file system type.

4. Description

The df command is widely used to generate statistical data on file systems. It displays information about all file systems in the system, including total capacity, available free space, and current installation points. When a super-Permission user uses the df command, the capacity of a partition exceeds 100%. This is because the Linux system reserves 10% of the space for Super Users, which is independently controlled by the Super Users. That is to say, for a super user, the disk capacity he sees will be 110%. This arrangement is advantageous for system management. When the disk capacity is close to 100%, the system administrator can still work normally.

5. Application Instance

Linux supports many file systems, including JFS, ReiserFS, ext, ext2, ext3, ISO9660, XFS, Minx, vfat, and MSDOS. When you use the df-T command to view disk space, you can also get the file system information: # df-T file system type capacity used available % mount point

// Dev/hda7 reiserfs 5.2G 1.6G 3.7G 30%/

/Dev/hda1 vfat 2.4G 1.6G 827 M 66%/windows/C

/Dev/hda5 vfat 3.0G 1.7G 1.3G 57%/windows/D

/Dev/hda9 vfat 3.0G 2.4G 566 M 82%/windows/E

/Dev/hda10 NTFS 3.2G 573 M 2.6G 18%/windows/F

/Dev/hda11 vfat 1.6G 1.5G 23 M 99%/windows/G

In addition to the capacity and usage of the disk space, the file system type and mount point of the partition are also displayed at a glance.

Top

1. Role

The top command is used to display the processes in execution. The permission is granted to all users.

2. Format

Top [-] [d delay] [q] [c] [S] [s] [n]

3. Main Parameters

D: Specify the update interval, in seconds.

Q: there are no delayed updates. If a Super User exists, the top command is executed in the highest priority order.

C: displays the complete process path and name.

S: The accumulation mode, which accumulates the CPU time of the completed or disappearing sub-itinerary.

S: security mode.

I: no Idle (Idle) or useless (Zombie) itinerary is displayed.

N: displays the number of updates. After the update is completed, the system will exit the top.

4. Description

The top command is a major command for Linux system management. It can obtain a lot of information. Here we use figure 1 to describe the information it provides.

Figure 1 display of top commands

In Figure 1, the items in the first line are the current time, system start time, number of users logged on to the current system, and average load. The second line shows all started processes, currently running, suspended and useless processes. The third line shows the current CPU usage, including the proportion occupied by the system, user usage, and Idle ratio. The fourth line shows the usage of physical memory, including the total available memory, used memory, idle memory, and memory occupied by the buffer. The fifth line shows the swap partition usage, including the total swap partition, used, idle, and cache size. The sixth line displays the largest number of items. The detailed explanations are listed below.

PIDProcess ID): process ID.

USER: the USER name of the process owner.

PR: process priority.

NI: the priority value of the process.

VIRT: Virtual Memory occupied by the process.

RES: The physical memory occupied by the process.

SHR: the shared memory value used by the process.

S: Process status. S indicates sleep, R indicates running, Z indicates frozen, and N indicates that the priority of the process is negative.

% CPU: CPU usage occupied by the process.

% MEM: Percentage of physical memory and total memory occupied by the process.

TIME +: The total cpu time occupied by the process after it is started.

Command: the name of the startup Command that the process starts. If this line does not appear, the process has a complete Command line.

Some interactive commands can be used to complete other parameter functions during the use of the top command. These commands are started by using the shortcut key.

<Space>: refresh immediately.

P: sort by CPU usage.

T: sort by time and accumulated time.

Q: exit the top command.

M: Switch to Display memory information.

T: process and CPU status information is displayed during switchover.

C: Switch the display command name and the complete command line.

M: sort by memory size.

W: Write the current settings ~ /. Toprc file. This is a recommended method for writing top configuration files. As you can see, the top command is a powerful tool for monitoring the system, especially for system administrators. However, it consumes a lot of system resources.


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.