$ cp /source/* /destination/ cp: overwrite `/destination/file1.conf`
目标是将文件从源文件复制到目标文件而不需要提示或使用非别名(/)方法。
没有别名的命令
任何unix命令都可以用\作为前缀来获取非别名版本。
与别名
#-(0) :: /dev/shm/test2 > ls total 0 -rw-------. 1 root 0 Feb 24 16:29 a -rw-------. 1 root 0 Feb 24 16:29 b -rw-------. 1 root 0 Feb 24 16:29 c -rw-------. 1 root 0 Feb 24 16:29 d
没有别名
#-(0) :: /dev/shm/test2 > \ls abcd
我不知道“使用unalias方法”是什么意思,但如果你阅读cp手册页,你可以了解
-n, --no-clobber do not overwrite an existing file (overrides a previous -i option)
和
-u, --update copy only when the SOURCE file is newer than the destination file or when the destination file is missing
所以你会有两种方法来避免提示。 你需要决定哪种方法更适合你的目的。