Vi. Linux/unix operation commands Accumulate "kill, Netstat, df, du"

Source: Internet
Author: User
Tags aliases disk usage

under the use of Linux/unix, often use the text interface to set up the system or operating system, the author himself in the process of work is also constantly in touch with this command, so for This special brewing, preparation, began the writing of this article.

This paper mainly records some of their usual linux/unix under the operation of commands, record and collation, one can deepen the image. Two can record share.

I hope you crossing. In the case of inappropriate or ambiguous places, give indication and explanation in order to learn and improve together.
"Reproduced use, please specify the source:http://blog.csdn.net/mahoking"
023 KILL command: View process and kill process

The view process uses the PS command, this example demonstrates the Ps–aux command.

-a displays all programs under the current terminal, including other users ' programs.

-U Displays the status of the program in a user-oriented format.

-X shows all the programs, not the terminal to distinguish.

A frequently used combination is to use the grep command filter to find a specific process through a pipeline and then manipulate the specific process.

format:PS aux | grep Program_filter_word

Demo Sample:ps-ef |grep Tomcat

Note: Find the process task information for Tomcat.

1 command format

Kill [option] format PS [option] PID

2 command functions

The KILL command is used to abort a process.

3 Frequently used examples

Example 01

Command: kill-9 326

Input:

[[Email protected]]# kill-9 326

Description:

Forcibly abort (often used to kill) a process with an identification number of 326.

-9 means that the forced process stops immediately.

024 netstat command: Displays various network-related information

1 command format

netstat [options] format netstat[option]

2 command functions

The netstat command is used to display various network-related information, such as network connections. The routing table. Interface State (Interface Statistics). Masquerade connections, multicast members (multicast memberships), and more.

3 Frequently used examples

Example 01

Command: Netstat-an

Input:

[[Email protected]]# Netstat-an

Description:

-A (All) displays all options and does not show listen correlation by default.

-N refuses to display aliases, which can show all conversions of numbers to numbers.

Extensions:

-T (TCP) displays only TCP-related options.

-U (UDP) displays only UDP-related options.

-I lists only service statuses that are in Listen (listening)

Example 02

Command: Netstat-an | grep 8080

Input:

[[Email protected]]# Netstat-an | grep 8080

Description:

filter Query 8080port.

-A (All) displays all options and does not show listen correlation by default.

-N refuses to display aliases, which can show all conversions of numbers to numbers.

025 DF Command: Check the file system for disk space consumption

1 command format

DF [option] format DF [option]

2 command functions

Displays the free space for the specified disk file. Assuming no file name is specified, the free space for all currently mounted file systems will be displayed. By default, disk space is displayed in 1KB unless the environment variable posixly_correct is specified. That will be displayed in kilobytes .

3 Frequently used examples

Example 01

Command: DF

Input:

[Email protected]]# DF

Description:

Displays disk usage.


Example 02

Command: Df–t

Input:

[[Email protected]]# df-t

Description:

Lists the types of file systems.

-T file system type.

Extensions:

-H more Current disk space and usage are displayed in an easier-to-read manner.

The-H-parameter above the-H root is also used to convert capacity by 1000 instead of 1024 when the radicals are initialized.

-K Displays the usage of the disk in units.

-L Displays the disk space utilization of the local partition, assuming that the disk of the remote server is SERVERNFS, then the system displays the result after the filter NSF drive is added to the DF after adding-L.

026 du command: View the space used by files and folders

1 command format

Du [options] file format du [option] files OR Dir

2 command functions

Displays the disk usage space for each file and folder.

3 Frequently used examples

Example 01

Command: Du

Input:

[Email protected]]# du

Description:

Displays disk usage.


Example 02

Command: Du Test.log

Input:

[Email protected]]# du Test.log

Description:

Displays the space occupied by the specified file.


Example 03

Command: Du TestDir

Input:

[Email protected]]# du TestDir

Description:

Displays the space occupied by the specified folder.


Example 04

Command: Du-s TestDir

Input:

[Email protected]]# du–s TestDir

Description:

Displays the total amount of space the file occupies under the specified folder.

"Reproduced use, please specify the source:http://blog.csdn.net/mahoking"

Vi. Linux/unix operation commands Accumulate "kill, Netstat, df, du"

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.