linux copy 命令在哪

如题所述

which copy
[root@bogon ~]# which copy
/usr/bin/which: no copy in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/mysql/bin/:/root/bin)
由此可以看到,Linux里面没有copy命令,如果是想要复制的话,可以通过cp命令,如果想要移动可以通过mv命令:
示例:
[root@bogon ~]# touch a.txt
[root@bogon ~]# ll a.txt
-rw-r--r-- 1 root root 4 3月 20 12:55 a.txt
[root@bogon ~]# echo aaaaa > a.txt
[root@bogon ~]# cat a.txt
aaaaa
[root@bogon ~]# cp a.txt b.txt
[root@bogon ~]# cat b.txt
aaaaa
[root@bogon ~]# mv a.txt c.txt
[root@bogon ~]# cat c.txt
aaaaa
[root@bogon ~]# ll a.txt
ls: 无法访问a.txt: 没有那个文件或目录
[root@bogon ~]# ll c.txt
-rw-r--r-- 1 root root 6 3月 20 12:56 c.txt
[root@bogon ~]# ll b.txt c.txt
-rw-r--r-- 1 root root 6 3月 20 12:56 b.txt
-rw-r--r-- 1 root root 6 3月 20 12:56 c.txt
[root@bogon ~]# cat b.txt
aaaaa
[root@bogon ~]# cat c.txt
aaaaa
温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-03-20
常用的命令为# cp命令
方式一:对文件进行copy:

#cp object_file source_file
方式二:对目录下文件进行copt:

#cp -r object_file source_file
相似回答