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

Copying multiple files

You may also want to copy multiple files at once. To  demonstrate, let's begin by creating three files apple.txt, banana.txt, and carrot.txt in Elliot's home directory:

elliot@ubuntu-linux:~$ touch apple.txt banana.txt carrot.txt
elliot@ubuntu-linux:~$ ls
apple.txt carrot.txt copycats.txt dir1
banana.txt cats.txt Desktop

elliot@ubuntu-linux:~$

To copy the three newly created files to /tmp, you can run the cp apple.txt ba- nana.txt carrot.txt /tmp command:

elliot@ubuntu-linux:~$ cp apple.txt banana.txt carrot.txt /tmp
elliot@ubuntu-linux:~$ cd /tmp
elliot@ubuntu-linux:/tmp$ ls
apple.txt banana.txt carrot.txt cats2.txt cats.txt
elliot@ubuntu-linux:/tmp$

Child’s play! In general, the cp command follows the syntax:

cp source_file(s) destination
主站蜘蛛池模板: 成武县| 东山县| 朝阳市| 达孜县| 辽宁省| 宜章县| 甘洛县| 中卫市| 鄂托克旗| 得荣县| 延川县| 常熟市| 吉水县| 海安县| 建宁县| 福清市| 于都县| 江陵县| 莫力| 定州市| 延安市| 丽江市| 石门县| 萝北县| 基隆市| 洱源县| 凤凰县| 二连浩特市| 伊金霍洛旗| 定西市| 巴彦县| 保山市| 绥滨县| 建昌县| 宜川县| 界首市| 大竹县| 曲沃县| 韶关市| 米易县| 金塔县|