Linux common file basic instructions

help command

man       man ls

help Get help information for viewing shell built-in commands (cd)

Commonly used convenience

ctrl+c to stop the process

ctrl+l clear screen (clear) completely clear screen (reset)

file directory class

pwd : display the absolute path

ls [Options]: Display all directory contents under the current file

     Options: -a all files including hidden files

                -l long data list (equivalent to ll)

cd path: switch paths

mkdir [option] filename: create a new folder

              Option: -p can create multi-level directories

rmdir filename: delete an empty folder

touch filename: create an empty file

cp [option] original file destination file: copy file operation

      Options: -r copy entire folder recursively

rm [option] filename: delete file

       Option: -r deletes all contents of the directory recursively

                 -f force delete operation

                 -v displays the detailed execution process of the command

mv old new : move files or rename them

cat view file

more View the file: [space bar: turn down one page] [enter: next line]

                            【q to leave】 【B to return to the previous screen】      

less View files: / string (downward to find the specified string)? substring (look up for the specified string)

echo: output content to the console

head [option]: display the information of the file header

           Options: -n 5 display 5 lines

 tail [option]: display the information at the end of the file

          Options: -f Track all updates to this document in real time

output redirection > append >>

1) ls -al > file: write the content in the list to the file (overwriting)

     echo content >> file Append content to file

soft link

Establish a soft connection: ln -s turns out to be now

Delete soft connection: rm -rf soft connection name      rm -rf soft connection name/[The real file directory will also be deleted]

history View historical commands

  date displays the current time

  date +%Y%m%d display year, month, day %H %M %S hour minute second

  date -d '1 days ago': display the time of the previous day

  date -d '-1 days ago' : display tomorrow's time

set system time

date -s "Standard format of time YY-MM-dd hh:mm:ss"

cal view calendar

               

Guess you like

Origin blog.csdn.net/qq_57533658/article/details/130014493