linux system operation and maintenance of the common operation and maintenance engineers skills commands finishing record

This blog records of work requiring operation and maintenance of linux command, when the university came into contact with linux, will be some of the basic operations, but did not finish it, plus do the development, operation and maintenance do, some commands forgotten, so now organized into blog of course vi, file operation is not introduced, and slowly accumulated some other expansion command, blog from time to time update

System Tutorial point I learned

Directory article
a, the monitoring system
1, free command
2, ulimit command
3, top command
4, df command
5, ps command
II file operation
1, tail command
2, ll -ah
three network communication
. 1, the netstat
2, reboot the network
. 3, the SELinux
. 4, firewall
Fourth, the system management
. 1, the uname
2, IP addr
a system monitor
. 1, free command
free command can be displayed on the idle system and physical memory has been used, as well as exchange of the memory, while also displaying and the cache buffer is used by the kernel

Syntax: as Free [param] 1
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 column;
-s <spaced seconds>: memory usage is continuously observed;
-t: columns show the total memory;
-V: display version information.

Mem: represents the physical memory statistics

total: represents the total number of physical (total = used + free) memory
used: represents the number assigned to the buffer use (buffer herein include buffer and Cache)
Free: represents the physical memory is the total number of unallocated
shared: represents the shared memory
buffers: the system assigned but the number of unused buffers.
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) Number of Memory: (free means the first portion of the Mem line 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 parameters may 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 that can be used in units of KB
3, top commands
top command to view the real-time dynamic operation of the system as a whole, is a combination of multi-utility monitoring system performance and operating information of information

Syntax: Top [param] 1
param is:

-b: in batch mode;
-c: display the full rule command;
-d: Screen refresh interval;
the -I: ignore the failure process;
-s: privacy mode;
-S: Cumulative mode;
-u [username ]: Specifies the user name;
-p [process ID]: Specifies the process;
-n [number]: the 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

# Ps command alone where
PS -elf Tomcat
# grep command in conjunction with pipelining and filtered query for information on a process
PS -elf | grep Tomcat
. 1
2
. 3
. 4
II file operations
. 1, the tail command
tail command available to view the contents of the file, the syntax is

tail [param] [filename] 1
wherein param may be:

-f: cycle reading
-q: does not display information
-v: displaying detailed information processing
-C [number]: the number of bytes displayed
-n [rows]: n display lines tail content file
-pid = PID : combined with the -f, represents the process ID, PID dies after ending
-q, -quiet, -silent: never output headers giving file names
-s, -sleep-interval = S: in combination with the -f, expressed in each iteration of sleep interval seconds S
2, ll -ah
case ll -ah command can be used to view the file

-ah LL
. 1
Third, the network communication
. 1, the netstat
the netstat command packet is a network interface and access to network statistics monitoring command-line tool

Syntax: the netstat [param]. 1
param parameters may be:

-h: View help
-r: Displays the routing table
-i: View Network Interface
2, restart the network
set up linux network, you need to restart the network, you can use the command:

 

System Tutorial point I learned

Network restart Service
1
3, SELinux
SELinux stands for Security-Enhanced Linux, which is by the US National Security Agency (NSA) contributions, it introduces a robust mandatory access control Mandatory Access Control framework for the Linux kernel subsystem. For more information please refer to SELinux entry, SELINUX works

In fact, SELinux functionality that is similar to the function of the firewall, but security is relatively good, ok, so this blog to introduce SELinux use the command

View selinux state

getenforce
1
Temporarily disable SELINUX (learn linux can disable the use of the production does not recommend disabling SELINUX)

setenforce
1
permanently disabled SELINUX (learn linux can disable the use of the production does not recommend disabling SELINUX)

The SELINUX = enforce # = Disabled into the SELINUX
VI / etc / SELinux / config
. 1
2
. 4, the firewall
queries on state firewall system linux

the -state-cmd Firewall
1
temporarily turn off the firewall (linux learning disabled before they can use, production does not recommend disabling SELINUX)

STOP firewalld.service systemctl
1
permanently shut down the firewall (linux learning disabled before they can use, production does not recommend disabling SELINUX)

disable firewalld.service systemctl
1
Fourth, the management system
1, uname
uname command is used to view the kernel version

2, ip addr
view linux ip address: You can use the command

ip addr

Published 89 original articles · won praise 63 · views 40000 +

Guess you like

Origin blog.csdn.net/aa541505/article/details/104072714