Related operations Linux04 directory (mkdir, rmdir, rm, cp)

First, create a directory: mkdir

  mkdir directory name

Second, delete the directory: rmdir / rm

  rmdir directory name

  rm -r directory name of each subdirectory will be asked whether to delete

  rm -rf directory name with caution, give you sufficient rights, you can delete all the system files, the entire project team can be all clean and delete

Third, file and directory replication: cp

  cp file or directory name of the target address

1 keshengtao @ LAPTOP in-F9AFU4OK: ~ $ ls is
 2  kkkpy
 3 keshengtao LAPTOP in-F9AFU4OK @: ~ $
 + 4 keshengtao LAPTOP in-F9AFU4OK @: ~ $ the cd
 5 keshengtao LAPTOP in-F9AFU4OK @: ~ $ ls is
 6  kkkpy
 7 keshengtao @ F9AFU4OK-LAPTOP in: ~ $ the mkdir the test
 8 keshengtao LAPTOP in-F9AFU4OK @: ~ $ ls is
 is 9  kkkpy the test
 10 keshengtao LAPTOP in-F9AFU4OK @: ~ $ the mkdir test learn
 11 keshengtao LAPTOP in-F9AFU4OK @: ~ $ ls is
 12  kkk the test .py
 13 keshengtao LAPTOP in-F9AFU4OK @: ~ $ ls is test
 14 learn
15 keshengtao@LAPTOP-F9AFU4OK:~$ ls
16 kkk.py  test
17 keshengtao@LAPTOP-F9AFU4OK:~$ rm -r test/
18 keshengtao@LAPTOP-F9AFU4OK:~$ ls
19 kkk.py
20 keshengtao@LAPTOP-F9AFU4OK:~$ mkdir test
21 keshengtao@LAPTOP-F9AFU4OK:~$ mkdir ./test/learn
22 keshengtao@LAPTOP-F9AFU4OK:~$ rm test/
23 rm: cannot remove 'test/': Is a directory
24 keshengtao@LAPTOP-F9AFU4OK:~$ ls
25 kkk.py  test
26 keshengtao@LAPTOP-F9AFU4OK:~$ cp kkk.py ./test/learn/
27 keshengtao@LAPTOP-F9AFU4OK:~$ ls
28 kkk.py  test
29 keshengtao@LAPTOP-F9AFU4OK:~$ cd test/learn/
30 keshengtao@LAPTOP-F9AFU4OK:~/test/learn$ ls
31 kkk.py
View Code

 

Guess you like

Origin www.cnblogs.com/ksht-wdyx/p/11577180.html