Section 2: Use the directory
2.1. Catalog: Preface
We have seen DOS and Linux different in archival processing. In the directory, DOS is used /
Represents the root directory, Linux is /. The same, the catalog of neo-shapes, DOS is also used / to separate each level
Directory, Linux is used /. 比方 方方:
DOS: /PROGRAMS/C /sources/hello.cpp
Linux: /Home/guido/papers/geology/mid_eocene.tex
The same is, .. Represents the previous layer directory, indicating the current directory. Remember one thing, the system does not allow you to be in any
Local CD, RD, or MD. Every user has a directory called HOME, (this is system management
Person allocated) For example, on my own PC, my home is / home / guido.
2.2. Corresponding to the relevant instructions in DOS and Linux
DIR: LS, Find, DU
CD: CD, PWD
MD: mkdir
RD: RMDir
- - EXAMPLES -
Dos Linux
C: / Guido> DIR $ LS
C: / Guido> Dir file.txt $ ls file.txt
C: / Guido> DIR * .H * .C $ ls * .h * .c
C: / Guido> DIR / P $ LS | More
C: / Guido> DIR / *.TMP / S $ FIND / -NAME "* .tmp"
C: / Guido> CD $ PWD
N / A - See Note $ CD
N / A - See Note $ CD ~
N / A - See Note $ CD ~ / TEMP
C: / Guido> CD / Other $ CD / OTHER
C: / Guido> CD ../temp/trash $ cd ../temp/trash
C: / Guido> MD NewProgs $ MKDIR NewProgs
C: / Guido> MD / Progs / Turbo $ MKDIR / PROGS / TURBO
C: / Guido> RD NewProgs $ RMDIR NewProgs
C: / Guido> RD / Progs / Turbo $ RMDIR / PROGS / TURBO
Note: ~ is an abbreviation of Home. CD ~ can make you back to your own home, no matter where you are.
CD ~ / TMP will take you to / home / your_home / tmp. This way, can you understand??