Common Linux system operation and maintenance command summary

  Because this time adding Java development background, so the Linux system commands Java development background will surely be familiar to summarize here;

  takes

  Parameter Description: -x: extract the -z: gzip properties have -v: displays all process -f: filename -c: create archive

  Decompression: tar -xzvf file.tar

  Compression: tar -czvf /home/ccc.tar ccc /

  View archive content: tar tfz ccc.tgz

  Extract the specified file: tar -zxvf ccc.tgz mylog.txt

 

  ll / ls

  Parameters: -h: in MB view file size -s: -t sort by file size: file sorted by time

  Get the current folder file: ls -al | grep "^ -"

  Get the current folder within a folder: ls -al | grep "^ d"  

 

  find

  Parameter Description: -type: f indicates the type of file -size: file size limit -name: filename

  Query large files: find / -type f -size + 100M

  According to the file name to find: find / -name * .txt

  

  We / less

  Instruction: dd: delete a row shift + g: go to the last line of the spacebar: b on page: Page Down

  Modify the file: vi ccc.txt

  View File: less ccc.txt

 

  netstat / telnet

  Discover all ports: netstat -anp

  Determining whether the port through: telnet 102.13.33.104 2021

  According to the investigation process pid port: netstat -nap | grep pid

  According to port port check process: netstat -nap | grep port or lsof -i: port

 

  grep

  Parameters: -E: Regular expression search -v: Non -A / -B / -C: after matching with the output to the front, the front and rear lines -o: only matching portion

  This section is more complex, using a lot of follow-up after supplementation.

 

  tcpdump

  The port number Ethereal: tcpdump tcp -i eth0 -t -s 0 dst or src port 9080 -w a.cap

  Catch all tcp packets: tctdump tcp -i eth0 -t -s 0 -w a.cap

 

  These are the most commonly used several linux instruction, subsequent supplemental.

 

Guess you like

Origin www.cnblogs.com/chenchaochao034/p/11426360.html