Since entering the pit of node. js, it is unavoidable to deploy some applications on the Linux server. So I'm going to start learning the basics of Linux and sort it out for you when you need it.
1. Query the contents of the directory: LS
ls Options [File or directory]
-a displays all files, including hidden files
-L Show Details (I usually use the shorthand is LL)
-D Display Directory properties
-H humanized Display file size
-I display Inode
2. Create directory: mkdir
mkdir -P [directory name]
-P Recursive creation
Example:
Mkdir-p Dir1/file1
3. Where to switch: CD (change directory)
Simplified operation:
CD ~ Enter the current user's home directory
CD - go to last directory
CD .. Go to the top level directory
4. Delete files or directories: RM (remove)
RM -RF [file or directory]
-R Delete Directory
-F Mandatory
5. Copy command: CP (copy)
CP [Options] [Original file directory] [Target directory]
-R Copy Directory
-P Joint File attribute copy
-D If the source file is a linked file, copy the link property
-A equals-pdr
6. Cut or rename command: MV (move)
MV [Original file or directory] [Target directory]
7. Link command: ln (link)
LN -s [original file] [target file]-s create soft link (similar to shortcut) hard link has the same I node and storage block block can be considered as a file (two portals of a file)
8. File Search: Locate
Locate file name search in background database by file name search faster /var/lib/mlocatelocate command searches the background database updatedb when the newly created file is not updated into the background database Unable to search for this file with locate the general system automatically updates the background database once a day to manually update the command and then to search for the newly created file
Linux Common Command collation