pwd

  • Gets the absolute path of the current location

ls

  • View all files in the current path

ls -a

  • View all files in the current path, including hidden files

cd

  • Go to a directory
  • CD or CD ~Returns the topmost directory
  • cd .. Return to parent directory
  • cd – Returns the previous directory

mkdir

  • The mkdir filenameCreate a directory

rmdir

  • Delete the specified directory. Ensure that there is no content in the directory; otherwise, the deletion fails

mv

  • Mv Old file new addressCut the file to the new address

rm

  • Rm Deleting a file
  • Rm -rf Specifies the file nameDelete files (* or delete all files)

cp

  • Cp File directory New file directoryCopies the specified file to the new address
  • Cp -r directory 1 directory 2 Directory 3Copy directories 1 and 2 to directory 3. Multiple directories can be created. Both directories are copied to the last directory

!

  • ! lView the last command that starts with l and execute it

history

  • View all the executed commands

top

  • View all processes as task manager
  • According to q to exit the

touch

  • Creates a file. If the file already exists, the system updates the file creation time to the latest

cat

  • cat>a.txt Write text to a.txt, press Control + D to exit and save

vim

  • To view the file, press I to edit the file,shift+: enter wq to save the file and exit

more

  • More filesViewing file Contents

grep

  • grep 88 a.txt Check to see if the string 88 exists in a.txt and print it if it does
  • grep 88 -n a.txt Print the line number in front if it exists
  • grep .txt * Find the names of all files in the current directory or files whose contents include. TXT
  • set | grep PATH Viewing environment Variables

du

  • du -sh * View the size of all files in the current directory

tar

  • tar -czf test.tar.gz /test1 Zip test1 to test.tar.gz
  • tar -tzf test.tar.gz View the content list of the current compressed package
  • tar -zxvf test.tar.gz Stress test. The tar. Gz
  • unzip test.zip Stress test. Zip

wget

  • Wget linkDownload link content
  • Wget -o outputtar. Gz linkDownload the content of the link and name it outputtar.gz
  • Wget links – no – check – certificate--no-check-certificate --no check certificate --no check certificate --no check certificate

Refer to the article