官术网_书友最值得收藏!

  • Learn Linux Quickly
  • Ahmed AlKabary
  • 92字
  • 2021-06-11 18:43:48

Copying multiple directories

You can also copy multiple directories the same way you copy multiple files; the only difference is that you have to pass the recursive -r option to the cp command.

To demonstrate, create the three directories d1, d2, and d3 in Elliot's home directory:

elliot@ubuntu-linux:~$ mkdir d1 d2 d3

Now you can copy all three directories to /tmp by running the cp -r d1 d2 d3 /tmp command:

elliot@ubuntu-linux:~$ cp -r d1 d2 d3 /tmp
elliot@ubuntu-linux:~$ cd /tmp
elliot@ubuntu-linux:/tmp$ ls
apple.txt banana.txt carrot.txt cats2.txt cats.txt cities d1 d2 d3
主站蜘蛛池模板: 昭平县| 开平市| 绵阳市| 泽普县| 儋州市| 邓州市| 澳门| 牙克石市| 克东县| 濉溪县| 乌拉特后旗| 吐鲁番市| 云南省| 右玉县| 灵川县| 葵青区| 杨浦区| 石棉县| 嘉黎县| 古浪县| 东平县| 广汉市| 布尔津县| 芜湖市| 洪湖市| 桃江县| 泾阳县| 达拉特旗| 社会| 文化| 龙里县| 什邡市| 南通市| 白水县| 建德市| 黔东| 达州市| 汉源县| 土默特左旗| 萨嘎县| 通化县|