"Linux command line and Shell Scripting Encyclopedia" chapter Fourth

Source: Internet
Author: User
Tags disk usage

4.1 Monitoring procedures

1. PS defaults to only the processes that are running under the current console that belong to the current user. You can take many options, such as-a for all processes-E, and so on.

2. Ps-l View process More information

UID: The user who initiated these processes

PID: Process ID of the process

PPID: Process ID of the parent process

C: CPU utilization in the process life cycle

TTY: Terminal equipment at process start-up

Time: Running the process requires cumulative CPU times

CMD: Startup program Name

PRI: The priority of the process (the larger the number represents the lower the priority)

ADDR: Memory address of the process

F: System token assigned to the process by the kernel

S: The status of the process (O is running, S is sleeping, R is running, T stands for Stop, Z is the zombie process, the process has ended the resource has not been recycled, but the parent process is gone, and no one is getting their corpse)

SZ: If the process is swapped out, the approximate size of the required swap space

There is another kind of

4.1.2 Real-time monitoring process

Top: This is displayed in real time.

4.1.3 End Process

Kill 4223 Direct Input process ID number end

Killall http* ends the process with the process name, killing all processes that begin with HTTP

Add: Knowledge about catalogs:

1. Linux stores files in a single directory structure, which is called a virtual directory

The virtual directory incorporates the file paths of all storage devices installed on the PC into a single directory structure.

The 2./home/xcy/test/1.c path itself does not provide any information about exactly which physical disk the file resides on

The first hard drive installed on a 3.linux PC is called the root drive. The root drive contains the core of the virtual directory, where other directories start to build.

4. Linux creates some special directories on the root drive, which we call mount points. Mount points are directories in the virtual directory that are used to allocate additional storage devices. Virtual directories cause files and directories to appear in these mount point directories, but in fact they are stored in a different drive.

4.2 Monitoring disk space

Definition: The Linux file system merges all the disks into a virtual directory, and before using the new storage media, it needs to be put into the virtual directory, which is called mount (mounting).

1.mount: Output The list of devices mounted on the current system by default

You can see four part information: Media Device file name, media mount to virtual directory mount point, File system type, access status of mounted media

2. After the media device is attached to the virtual directory, the root user has all access rights to the device, while the other user is restricted.

3. Umount. When a removable device is removed from Linux, it cannot be removed from the system and should be uninstalled first. Ah, still do not understand.

4.DF: Check the usage of all mounted disks, or df-h. Easier to read

5.DU: Quickly view disk usage in the directory (default is the current directory). You can also add the-H parameter.

-C Displays the total size of all listed files

-S shows the total of each output parameter

4.3 Working with data files

Sort by: Sort file

You can also connect many parameters.

such as Sort-t ': '-K 3 test

You can think of it as something inside. xxx1:xxx2:xxx3:xxx4:xxx5

means to sort the xxx3

-T: Specifies a character to distinguish the key position

-K:--key=pos1[pos1]. The sort starts with pos1, and if POS2 is specified, it ends at Pos2.

| Redirects the output of the du command to the sort command.

-r: Indicates descending order.

Here is an example:

4.3.2

1. grep [options] pattern [file]

For example:

grep t test//Search for text in test that can match pattern t

Grep-v t test//Match without T

-N can add line numbers

-E matches multiple modes, GREP-E t-e F Test//Find all lines with T or F

4.3.3 compressing data

4.3.4 Archive Data Tar

"Linux command line and Shell Scripting Encyclopedia" chapter Fourth

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.