Linux Command & my Centos7 operation and maintenance

Uninstall software

Install the software under linux, how do you know the software installation location

Note: The default installation directory general software in / usr / local or / opt in, you can go there to look for.

whereis v3ray (the most practical, to find out directly deleted)

which v3ray

yum remove v3ray

systemctl disable v3ray (prohibiting boot)

 

Environment Variables

vi /etc/profile

cat /etc/profile

 

Check disk space size

df -hl

File system capacity has been available with a mount point%

Check the size of the root directory usr folder

you -sh usr

 

View memory usage

free -m

 

Port occupancy

netstat -tlnp

 

View nginx process

ps aux | grep nginx

PS -ef | grep nginx

 

View tomcat running log

# Displays the last 100 rows of data

tail -n 100 /etc/cron

Constantly refreshed

tail -f catalina.out

View logs by keyword search

cat jeewx-2015-09-20.log | grep verification code

View a fixed time log

cat jeewx-2015-09-20.log | grep '2015-09-20 18:50:15'

cat

Display the entire file

head

View start from the head of the text file, head command to view a text file beginning

more

View the log as a percentage

less

With more features similar, but less support to read files before and after

 

Screen roll

Shift + g: Turn bottom file (shift + g)

Ctrl + u: the first turn and a half screen (ctrl + u) to file

Ctrl + d: turn half screen (ctrl + d) to the end of the file

Ctrl + b; first turn a screen (ctrl + b) to file

Ctrl + f: turn a screen (ctrl + f) to the end of the file

 

Search Commands

/ Pattern: from the cursor to the beginning of the end of the file search pattern (/ keywords)

? Pattern: from the cursor to the beginning of the first file search pattern (keyword?)

n: in the same direction to repeat the last search command (n)

N: in the opposite direction to repeat the last search command (shift + n)

 

copy and paste

ctrl + z: Force Quit, useful (ctrl + z)

ctrl + insert: Copy

ctrl + shift + v: Paste

Guess you like

Origin www.cnblogs.com/lovesufang/p/12616274.html