linux series of commonly used command operation and maintenance

First, system monitoring

1, free command

The free command can be displayed on the idle system and physical memory has been used, as well as exchange of the memory, while the display buffer and cache can be used by the kernel

Syntax: free [param]

param can be:

-b: Displays a Byte memory usage;

-k: in KB display memory usage;

-m: in MB display memory usage;

-o: not display buffer adjustment columns;

-s <interval seconds>: Memory usage is continuously observed;

-t: Display memory column sums;

-V: Display version information.

Mem: represents the physical memory statistics

total: represents the total number of physical (total = used + free) memory

used: indicates the number of buffers assigned to the system used (here includes cache and buffer cache)

free: represents the total physical memory unallocated

shared: shared memory representation

buffers: the number of buffers assigned by the system but not in use.

cached: the number of cache system allocated but not used.

- / + buffers / cache: represents the physical memory of the cache statistics

(-Buffers / cache) Number of Memory: (used to refer to a first portion of the Mem line - buffers - cached)

(+ Buffers / cache) Memory Number: (refer to the first portion of the Mem line free + buffers + cached)

(-Buffers / cache) represents the amount of memory actually used, (+ buffers / cache) represents a real number of unused memory

Swap: represents the usage of the swap partition on the hard disk

2, ulimit command

ulimit for information display system resource limits

Syntax: ulimit [param]

param parameter can be:

-a display the current resource limit settings.

-c <core Maximum file> set the maximum core file, in units of blocks.

-d <section data block size> maximum section area of ​​the program data in units of KB.

Maximum file can be established -f <file size> shell, in units of blocks.

-H resources to set hard limits, which is under the limit set by the administrator.

-m <memory size> Specifies the upper limit of the memory, in units of KB.

-n <number of files> Specifies the same time open up the number of files.

-p <buffer size> Specifies the size of the pipe's buffer, 512 units of bytes.

-s <stack size> specifies the upper limit of the stacked units of KB.

-S set elastic resource constraints.

-t <CPU time> specify the maximum time a CPU, a seconds.

-u <program number> program number of the user can open up.

-v <virtual memory size> specifies the maximum virtual memory can be used, in KB

3, top command

the top command to view the real-time dynamic operation of the system as a whole, is a combination of information from multiple utilities to monitor system performance and operational information

Syntax: top [param]

param is:

-b: batch mode;

-c: display the complete cure command;

-d: Screen refresh interval;

-I: Ignore failure process;

-s: privacy mode;

-S: accumulation mode;

-u [User Name]: Specifies the user name;

-p [process ID]: Specifies the process;

-n [times]: number of cycles displayed.

4, df command

df -h to view disk usage

df -i to see inode usage

5, ps command

ps command to view process statistics

Common parameters:

a: show all processes information in the current terminal, including processes of other users.

u: Use user-based format of the output process information.

x: Displays the current user process in all terminals.

-e: display information about all processes within the system.

-l: Use a long (long) format to display process information.

-f: Use complete (full) format to display process information.

Can be used together with, in use, grep command, can be used alone

Where ps command used alone

ps -elf tomcat

# Combination of pipeline operations and grep command filters used to query the information on a process

ps -elf | grep tomcat

Guess you like

Origin blog.51cto.com/14477123/2463196