Relative path and absolute path:
root ) directory for the path. The relative path does not take the / start with an absolute path with / ./abc /abc is the absolute path. However: ~/abcd/123/ is an absolute path because ~
For example, the path followed by the LS command is recorded relative to the root :
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/08/61/wKiom1ngeCuzi6kMAAFg6uEVQ_U882.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 209.png "alt=" Wkiom1ngecuzi6kmaafg6uevq_u882.png "/>
Absolute path:
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A7/18/wKioL1ngdXXxJrY4AADjWVuYEDo145.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 218.png "alt=" Wkiol1ngdxxxjry4aadjwvuyedo145.png "/>
PWD can see which directory is currently under:
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/A7/18/wKioL1ngdXaAW4XFAAC0f8nwnqQ090.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 238.png "alt=" Wkiol1ngdxaaw4xfaac0f8nwnqq090.png "/>
The echo $PWD can also see which directory is currently under:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/08/61/wKiom1ngeCyjzktnAAED-LzGYmM353.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 266.png "alt=" Wkiom1ngecyjzktnaaed-lzgymm353.png "/>
WhoAmI is used to view the name of the current user:
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/A7/18/wKioL1ngdXaC_SmEAAD4lfXKjrI180.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 288.png "alt=" Wkiol1ngdxac_smeaad4lfxkjri180.png "/>
ID can view uid , etc.:
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/08/61/wKiom1ngeC2Q5Ws7AAEkt0Uy2uk938.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 303.png "alt=" Wkiom1ngec2q5ws7aaekt0uy2uk938.png "/>
CD command:
CD is Change directory The abbreviation is to change the meaning of the directory, you can use this command to enter the file directory:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/A7/18/wKioL1ngdXfA0IBlAAG-xaFvyzE305.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 363.png "alt=" Wkiol1ngdxfa0iblaag-xafvyze305.png "/>
If the CD does not add any parameters, it will go into the user's home directory, if your current user is root, then will go to the root directory:
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/08/61/wKiom1ngeC6zBwraAAHVNgbXd84786.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 403.png "alt=" Wkiom1ngec6zbwraaahvngbxd84786.png "/>
which directory can be accessed after the CD is appended with the directory name:
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/08/61/wKiom1ngeC_Cw9Z-AADvkm0c1dY118.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 426.png "alt=" Wkiom1ngec_cw9z-aadvkm0c1dy118.png "/>
The CD- command can go back to the last directory in which it was located:
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/A7/18/wKioL1ngdXmgCuotAAGpk4QzD2c551.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 451.png "alt=" Wkiol1ngdxmgcuotaagpk4qzd2c551.png "/>
The CD ~ command can be entered into the current user's home directory, and the meaning of the CD is consistent:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/A7/18/wKioL1ngdXrz05suAAC--_rjwME097.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 487.png "alt=" Wkiol1ngdxrz05suaac--_rjwme097.png "/>
Cd. go to current directory:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/08/61/wKiom1ngeDCRbErQAACXSz6BZtI914.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 503.png "alt=" Wkiom1ngedcrberqaacxsz6bzti914.png "/>
Cd.. go to the previous level directory:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/A7/18/wKioL1ngdXqj7zF4AAEBH7LIogs598.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 522.png "alt=" Wkiol1ngdxqj7zf4aaebh7liogs598.png "/>
To create and delete a directory:
mkdir is Make directory This command is used to create a directory of the :
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/08/61/wKiom1ngeDGQfVSWAANrD5LwutE616.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 574.png "alt=" Wkiom1ngedgqfvswaanrd5lwute616.png "/>
The date command can view the current system time:
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A7/18/wKioL1ngdXyRFBPvAAEISwPpUPI681.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 595.png "alt=" Wkiol1ngdxyrfbpvaaeiswppupi681.png "/>
The mkdir-p command allows you to create a directory in bulk:
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/08/61/wKiom1ngeDPBeVi9AALZABnt2_w395.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 620.png "alt=" Wkiom1ngedpbevi9aalzabnt2_w395.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/A7/18/wKioL1ngdX6j8fcbAAL4A_Cz2N8872.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 622.png "alt=" Wkiol1ngdx6j8fcbaal4a_cz2n8872.png "/>
The MKDIR-PV command adds a v option to display the process of creating a directory:
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/08/61/wKiom1ngeDaQLa4YAALxA9qSNis444.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 655.png "alt=" Wkiom1ngedaqla4yaalxa9qsnis444.png "/>
rmdir is Remove Directory abbreviation, this command is used to delete the directory, but only if the directory is empty or cannot be deleted:
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A7/18/wKioL1ngdYDRv39nAAF9dhPfBqM928.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 717.png "alt=" Wkiol1ngdydrv39naaf9dhpfbqm928.png "/>
Only the directory is empty to delete:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/08/61/wKiom1ngeDjB8jiwAAUWCAYeFvk532.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 732.png "alt=" Wkiom1ngedjb8jiwaauwcayefvk532.png "/>
the Touch command can create an empty file:
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/08/61/wKiom1ngeDixuGziAAHF8oXmEFk947.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 754.png "alt=" Wkiom1ngedixugziaahf8oxmefk947.png "/>
Rmdir-p can delete directories in bulk, and the same directory will be empty to delete:
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/A7/18/wKioL1ngdcTC4ydMAAD7ymYXWTQ549.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 788.png "alt=" Wkiol1ngdctc4ydmaad7ymyxwtq549.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/08/61/wKiom1ngeHvRMBe_AAHTTn18Ujs201.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 790.png "alt=" Wkiom1ngehvrmbe_aahttn18ujs201.png "/>
RM Command:
RM is The abbreviation for remove,rm can delete the directory or it can be deleted unless an empty file:
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/A7/18/wKioL1ngdcWRm5tQAAF7Dsid85M188.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 833.png "alt=" Wkiol1ngdcwrm5tqaaf7dsid85m188.png "/>
The RM-F command can be forced to delete without asking:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/A7/18/wKioL1ngdcbD03vBAAEB-2zmOQ4645.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 858.png "alt=" Wkiol1ngdcbd03vbaaeb-2zmoq4645.png "/>
The!tree command can run the last hit of the tree at the beginning of the command:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/08/61/wKiom1ngeIDygNeYAAdaqhJPvhA132.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 890.png "alt=" Wkiom1ngeidygneyaadaqhjpvha132.png "/>
The history command allows you to view previously-knocked commands:
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/A7/18/wKioL1ngdc-S4TQmAAzGkTy5Mow881.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 915.png "alt=" Wkiol1ngdc-s4tqmaazgkty5mow881.png "/>
The Rm-r command allows you to delete a directory in bulk, but each time you ask:
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/08/61/wKiom1ngeIbSdA0YAAMyfObagKg333.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 945.png "alt=" Wkiom1ngeibsda0yaamyfobagkg333.png "/>
The RM-RF command can delete a directory in bulk because the f option does not ask:
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/08/61/wKiom1ngeIayA--UAAC94jooFB4514.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 984.png "alt=" Wkiom1ngeiaya--uaac94joofb4514.png "/>
The RM-RFV command can see the removal process,v which is The function of the V option.
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/A7/18/wKioL1ngddDR3CLGAAFtrbWJUz8410.png "style=" float : none; "title=" Linux relative path and absolute path, CD command, create and delete directory, rm command 1018.png "alt=" Wkiol1ngdddr3clgaaftrbwjuz8410.png "/>
This article is from the "12831981" blog, please be sure to keep this source http://12841981.blog.51cto.com/12831981/1972131
Relative and absolute paths to Linux, CD commands, create and delete directories, RM commands