Xinxing finishing Linux part of the commonly used command

  

There are too many commands under Linux, here to temporarily organize a part, here we do not list specific parameters for practical purposes.

Part 1: File Operations

ll View directories and files in long format

ls View directories and files in short format

df -hView disk Size information

mkdir dir_name create folder

rm -rf file_name delete directory

rm -f file_name delete file

mv file path move file file Go to the path directory

cp file path Copy the file file to the path directory

cat file View the contents of the file

vi/vim file View the file

Pwd View the current file system path

uniq a.txt > b.txt Deduplicate a.txt and write the result to b.txt

sort a.txt > B.txt Write the result of a.txt to b.txt

uniq a.txt| Sort > b.txt For a.txt, first re-order and then write the result to b.txt

wc -l a.txt Count the number of a.txt lines

find path - Name file Look for the file named file in the path directory, you can use * as a wildcard

find path -name file_name |  Xargs grep -nH content Finds the specified content in the specified file

Part II: Process Information

ps -aux View Process Information

ps |  Grep java lookup process

kill -9 pid kill process according to process number

killall -9 java kill all java process

free view memory

Top Viewing CPU Information

Part III: rpm包管理

rpm -qa Listing all rpmware

rpm -qa |  Grep name Check if the software named name is installed

Part 4: Restart Shutdown

reboot Restart

shutdown -h now Shutdown


Part 5: Other Sections

passwd Change Password

& Background Startup Process

service network restart Restart Network Service

Copyright © Windows knowledge All Rights Reserved