Some common Linux command interview questions (notes)

View the processes with the highest CPU usage

ps aux-l | sort -k3nr | head -K   // k是想查看的数量

View the first 10 lines and the last 10 lines of the a.txt file

head -n 10 a.txt
tail -n 10 a.txt

How to filter lines containing "error" in a file

grep "error" file_name
cat file_name | grep 'error'

View a port number

netstat -anp | grep port_number

view a process

ps -ef | grep name

Create or delete a multilevel directory

mkdir -p ./a/b
rm -rf ./a

View log files dynamically

tail -f log_file

If the Xshell tool wants to upload or download files from the server, what package can be installed on the server?

yum install lrzsz

To be added. . .

Guess you like

Origin blog.csdn.net/weixin_46761622/article/details/116162167