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

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
主站蜘蛛池模板: 茂名市| 新沂市| 冷水江市| 泰宁县| 昌江| 南召县| 嫩江县| 普安县| 永州市| 涟水县| 宾川县| 会泽县| 锡林浩特市| 闽侯县| 尼玛县| 浙江省| 广水市| 精河县| 兰溪市| 姜堰市| 江津市| 阳原县| 永兴县| 团风县| 搜索| 天长市| 乾安县| 鸡西市| 太谷县| 乐昌市| 枣阳市| 新密市| 建德市| 疏附县| 曲麻莱县| 邵阳市| 淮南市| 北京市| 安陆市| 靖安县| 辽宁省|