Linux Basic Utility Commands collation--subsequent updates will continue

Source: Internet
Author: User
Tags database issues local time time and seconds root access server port

Monitoring:

Baidu Webmaster Tools

Smokeping Open source Monitoring, network monitoring

Real Machine Command Monitoring

Ipmitool can monitor hardware information but requires Yum to install Openlmpi Ipmtool

View System Module lsmod| grep IPMI

MEGACLI tool to view RAID disk array status (requires separate installation)

LSCPU Viewing system CPU Information

Cpu %sys% kernel state: Called when process is being used
%us% User state: Called when the user makes a process
60%-70% ratio is the bottleneck of I/O

Sysstat monitoring Performance

Mpstat Monitor CPU Mpstat 1 each time one line is displayed once per second

Memory

Iostat disk monitoring reads and writes to each process

Network card traffic monitoring (root access)

Iftop-n View Source IP Monitor network traffic the-n parameter is displayed in digital form

Ping-c 1-c parameter Count

Iptraf is similar to Iftop but requires a separate installation to directly see how the system process consumes bandwidth

Linux

“! "Anti-election type-f-name exec rm-rf {}\;

Rmkdir Deleting a directory

Sed-p Print-D Delete-I replace-n line number $ with what is the end ^ with what begins

Tree view directory tree structure

Seq-s Custom delimiter is consistent with awk-f

-W 0 before printing

Number of rows to fetch

20-30

head-30 Test.txt | Tail-11

Sed ' 20,30p ' test.txt

awk fetching line $NR ' {print $NR} ' NR is the line meaning

awk ' {if ' (if nr<31 && nr>19) print ' \ n '} ' test.txt

Grep-b matches the current number of rows

-c Number of rows before matching

-A number of rows after matching

-O matches only matches do not show other

-I is case insensitive

-S does not print other

-E can filter multiple strings

System built-in variable $ps1

echo $PS 1

[\[email protected]\h \w]\$

Export ps1= "[\[email protected]\h \w \t]\$" will appear time and seconds and Root will also appear $ instead of #

Linux default Run Level

/etc/inittab

RunLevel View current Run level

Regular:

Special characters

. Single any character * repeats the preceding multiple characters. * Match any character \ Escape ^ with what what begins $ with what what end ^$ empty line

Sed-r trailing arguments do not need to be escaped

-I change the matching content

-N Do not print other

-P Printing

awk {"\ n"} carriage return to newline

Ssh

Permitrootlogin no disable root login via SSH

Set SSH intranet only intranet can link

Vimdiff High volume more intuitive

Visudo =vi/etc/sudoers

Locate which type find to view command files

Awk-f ' [,] ' multi-separator; cut-d and awk-f are all delimiters

Inode smaller than block if the file is written small, then the inode value is easily stained-df-i

DUMPE2FS Viewing inode information

Alias grep= ' grep--color=auot ' grep will have color display

Export Global Assignment

Regular

[ABC] matches any character in the character set [A-z] [a-z] [0-9]

[^ABC] matches the [^bac] inverse of any character content in parentheses that does not contain ^

A[n,m] repeats N to M times before a repeating character, if egrep/sed-r/grep-e can be removed \

\{n,\} repeats at least n times before a repeating character

\{n\} repeats n times before a repeating character

\{,m}\ up to repeat m times

/sbin/ifconfig bond0 |grep "inet addr" |awk-f[: ""] ' {print $13} '

/sbin/ifconfig eth0 |sed-rn ' s#.*.:(. *) b.*#\1#p ' |sed-n ' 1p '

/sbin/ifconfig eth0 |sed-r ' s# (. *addr:) # #g ' |sed-r ' s# (bcast.*$) # #g ' |sed-n ' 2p '

/sbin/ifconfig eth0|sed-n ' s/.*addr://;s/bcast.*//p '

exists in the real server

Paste Print to a file with the file name and the contents of multiple files in a row

parted formatting files over 2T need to be improved first

Rename Batch change name

Renmae to change the name of the file to what to manipulate

Rename "AAA" "" *.jpg

Find./Type F-name "*finished*" | Sed-r ' s# (^.*) _finished (. *$) # mv & \1\2#g ' |bash

650) this.width=650; "src=" http://note.youdao.com/yws/res/2314/WEBRESOURCE9b2e534863de8473244b84262baf0b9a "/>

LS *.jpg |awk-f "_finished" ' {print ' mv $ "" $1$2} ' |bash

650) this.width=650; "src=" http://note.youdao.com/yws/res/2316/WEBRESOURCEebbe2eb50e7c3b1a770f7d2c18cbce4c "/>

Rename "_finished" "" "*.jpg

650) this.width=650; "src=" http://note.youdao.com/yws/res/2322/WEBRESOURCEa10f23862e51915e309d067590a43642 "/>

LVS Four layer Agent

OSI layer Seven and ISO five

Physical layer, Data link layer, network layer, Transport layer, presentation layer, Session layer, application layer

Dns

Dig Domain Name

Blkid Viewing Disk UID

Known port view process name:

Lsof-i: Port

Lsof-i del

Ss-p parameter Display process name

Netstat-p parameter Display process name

Linux

Traceroute Domain name Check parsing each node has no fix-through

Windows

TRACERT route tracking

Nmap 10.0.0.25-P 80 Check the remote server port is open

Not available: Service, firewall

Grab Bag: tcpdump

Tcpdump-n icmp-i Ech0

Nmap Scan

Slow website Access:

1, the user one or all

A.ping domain name Whether or telnet 80 port, if Ping does not drop packet http server problem, (service redundant machine, server overloaded) to lose the packet room bandwidth unstable each line unstable

B.TRACERT-D domain name can see the line through, the client to the server between the various lines

C.telnet 80 Check Server, Web service there is no opening and the fence is blocking/curl/wget

D. Whether the resource is overloaded, CPU, I/O load, number of connections

E. Server bandwidth purchase full, through the Traffic monitoring Service view

F. Intra-connection external links

G. Operator issues, database issues, storage issues, web issues

Useradd-d change default Properties-u uid-e Expiration Time

passwd--stdin do not prompt for interactive

Chage Changing password expiration properties

Sudo-l See what permissions the current user has, if the Visduo does not edit the user rights, it will be an error

650) this.width=650; "src=" http://note.youdao.com/yws/res/1370/WEBRESOURCE3f386e18b3ad65a135f02da552199190 "style = "float:left;"/>


Hwclock Viewing local time

Need to use parted format file when Linux system files are larger than 2T

The current environment becomes

-bash-4.1$ will be/etc/skel/under the new environment to copy the home directory can be

650) this.width=650; "src=" http://note.youdao.com/yws/res/1384/WEBRESOURCE0b9ad69c213b31c3bf6320ae94fe857f "/>

See if a network segment IP is

For i in ' seq 1 255 '; Do ping 192.168.3. $i-C-1 1 >/dev/null && 192.168.3. $i; Live | | echo 192.128.3. $i;d Ead;done

Alias Card

650) this.width=650; "src=" http://note.youdao.com/yws/res/2312/WEBRESOURCE007f6c73b050f4e0e119d67a1830a28c "/>


This article is from "gilt Son" blog, please be sure to keep this source http://19930412.blog.51cto.com/6974556/1909713

Linux Basic Utility Commands collation--subsequent updates will continue

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.