Linux common basic commands

Linux common basic commands

ls command

ls view files in the current directory

  • -l In addition to the document name, the document type, permission, owner, document size and other information are also listed in detail
  • -a displays all files, including hidden files (beginning with a dot)
  • -h easy human reading way

cd command

cd switch path

cat、more、less、tail、watch命令

The command used
by cat to display files is read page by page.
Less and more are almost the same.
Tail can be used to view the contents of files.
Watch provides a way to handle repetitive tasks. By default, watch will execute commands repeatedly every 2 seconds.
Tail and watch cooperate: watch -n 2 tail -20

cp and rm commands

rm delete file
cp copy and paste

  • -r If the source file given is a directory file, all subdirectories and files in the directory will be copied at this time.

top and ps commands

top monitors linux performance (a bit like window task manager)

  • k kill process
  • q exit

ps process information

  • -ef details are similar to aux

grep command

grep is used to find qualified strings in the file

chmod command

chmod permissions

netstat command

netstat is used to display network status

  • netstat -pantu this machine and which servers have connections

ifconfig command

ifconfig view ip

  • ifconfig xxx down turn off xxx
  • ifconfig xxx up open

mount command

mount is used to mount directories

dmesg command

dmesg is used to display boot information

find command

find find things

tar command

The tar command is used to backup files

man command

man help manual

whereis command

whereis find things

  • -b binary executable file

echo command

echo shows some information

  • -n do not wrap output

vi instruction

  • :Set nu plus a serial number
  • :Wq save the result content
  • i can edit
  • esc exit editing
  • dd delete a line
  • o Insert a line of editing under the cursor
  • v Copy
  • p paste

Pipe character

  • |The output of the previous command, as the next command parameter
  • || Indicates that the next command is executed after the previous command fails
  • & Indicates that the task is executed in the background
  • && means that the next command will be executed when the previous command is executed successfully

Linux command complete: https://www.runoob.com/linux/linux-command-manual.html

Guess you like

Origin blog.csdn.net/p_utao/article/details/107928163