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

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
主站蜘蛛池模板: 阜新市| 柘荣县| 安远县| 虎林市| 城固县| 海阳市| 西吉县| 峡江县| 陇川县| 河北省| 许昌市| 泸州市| 安西县| 霍林郭勒市| 通道| 太和县| 松阳县| 上虞市| 平顶山市| 潜山县| 江山市| 枝江市| 宜丰县| 彰武县| 肃南| 乌苏市| 张家川| 达州市| 澄江县| 花垣县| 郸城县| 定南县| 长白| 吉首市| 合川市| 万载县| 江都市| 板桥市| 阳东县| 昆山市| 富蕴县|