my_learn

rz -e forced downloads

sz

cut

-b bytes is not divided into parts cut -b 3

-F displays the contents of the specified field cut -f1,2  

-d specified field delimiter default tab

awk

awk 'BEGIN{ commands } pattern{ commands } END{ commands }'

awk ‘{i=$1;count[i]++}END{for(i in count)print(i,count[i])}’ /var/log/httpd/access_log

cat access_log | grep '12/Aug/2009' | grep '/images/index/e1.gif' | wc | awk '{print $1}

tcpdump

 the tcpdump [Options] [Not] proto type the dir
Options -i :-D port listed thereafter applied to monitor the
-i specified interface
-XX Output Header Data
-vvv show detailed output
-nn does not resolve the domain name is not resolving port
-c develop capture the number of
proto: protocol udp / tcp / ICMP / arp / ip / ether 
dir: developing direction and dst src src src dst dst or 
of the type: NET port Host portrange 
the Telnet user name and password for the remote port

perf

https://www.cnblogs.com/arnoldlu/p/6241297.html

 perf record -a -g ./fork

perf report --call-graph none

strace kernel call tracking

syscall Manual: http://man7.org/linux/man-pages/man2/syscalls.2.html

strace -tt -f  ./some_server ../conf/some_server.conf
File and device access classes such as open / close / read / write / chmod such as 
process management class fork / clone / execve / exit / getpid and other 
signals like signal / sigaction / kill and other 
memory management brk / mmap / mlock and other 
inter-process communication IPC shmget / semget * semaphores, shared memory, message queues and other 
network communication socket / connect / sendto / sendmsg like 
other
strace -p 17553 tracking program running 

-tt in front of each line of output, display milliseconds of time
-T display time for each system call takes
-v for certain related calls, the complete environment variables, file stat structure to break out.
-f target tracking process, the target process and all child processes created
-e control and tracking events you want to track behavior, such as specifying the name of the system call to be traced
-o strace output is written to a separate file specified by
-s when the system call the argument is a string of up to output the contents of a specified length, the default is 32 bytes
process pid -p designated to track, to track multiple pid, repeated several times -p option.

-e trace = file tracking and file access-related calls (parameter in the file name) 
-e the trace = process-related calls and process management, such as fork / Exec / exit_group
the trace = Network and network communications-related calls -e, such as Socket / the sendto / Connect
-e = the trace signal transmission and processing associated signal, such as the kill / the sigaction
-e desc = and the trace file descriptor associated, such as write / read / select / epoll like
-e trace = ipc students see the correlation process, For example shmget etc.

-c through statistical Xu calls the situation and the time they spent
when the target process and then stuck the user mode, starce no output

grep

-i ignore large primary school  

-n Display line numbers

The number -c statistics

-o only match keywords

-B equivalent of a few lines before before printing

-A equivalent to several lines after the printing after

-C -A and -B front binding print lines

-v negated

-e match multiple targets

-q silent mode

-E extended regular support equivalent to egrep

fgrep only match the string hardcoded but high efficiency data Qikuai

 

and 

sed [option] ... 'script' inputfile
option
-n do not output the contents of the pattern space to the screen, that does not automatically print
-e multi-point editing
-f / PATH / SCRIPT_FILE: edit the script to read from the specified file
-r supports extended regular expressions
-i edit files directly
-i.bak backup file and place edit
script address and bound
not to address: the full text processing
single address:
#: Specifies the line, $: the last line
/ pattern /: is this the pattern can be matched to each row
address range:
#, #
#, # +
/ PAT1 /, / PAT2 /
`#, / PAT1 /
~: step
1 2 odd rows
2 ~ 2 even line
editing commands:
D delete the line space pattern matching, and immediately enable the next cycle
p Print the current pattern space content, are appended to the default output
a [\] text1 in the specified line appends text to support the use of \ n multi-line append
i [\] text is inserted before text row
C [\] text replacement behavior single or multi-line text
w / path / somefile stored pattern matches to the specified file
r / path / somefile specified file is read into the text matches the pattern space to the line after the
= print line number of the line in the pattern space
! Space pattern matching row inversion processing
s ///: search and replace, support other separator, s @@@, s ###
replacement tags:
global replace the g line
p shows successful replacement row
w / PATH / TO save / sOMEFILE will replace the successful line to the file

Uniq ranks delete the text file recurring

-c display the number of repetitions of the line appears

-d display only repeat the ranks appear

sort sort

-t specified delimiter

-r reverse order

-n sort numerically

-k in the first few fields may sort the plurality of k

 

Guess you like

Origin www.cnblogs.com/leo001/p/11105543.html