【发布时间】:2020-05-02 19:09:41
【问题描述】:
我有一个文件夹,其中包含一个受源代码控制的.tmux.conf 文件,我想将该文件复制到~。这是其中的ls:
ubuntu@ip-172-180:~$ ls -alh .vim/others
total 12K
drwxrwxr-x 2 ubuntu ubuntu 4.0K May 2 19:05 .
drwxrwxr-x 6 ubuntu ubuntu 4.0K May 2 19:05 ..
-rw-rw-r-- 1 ubuntu ubuntu 706 May 2 19:05 .tmux.conf
但是,当我在该目录上执行 ls 时,我什么也得不到:
ubuntu@ip-172-30-1-180:~$ ls .vim/others/*
ls: cannot access '.vim/others/*': No such file or directory
与cp相同:
ubuntu@ip-172-30-1-180:~$ cp .vim/others/* .
cp: cannot stat '.vim/others/*': No such file or directory
复制点文件时是否需要添加一些额外的参数?
【问题讨论】:
-
* 扩展发生在之前(通过 shell),不是吗?也就是说,扩展失败(返回原始未扩展的值)并且两个命令都无法理解通配符 - 因此失败,因为确实没有该名称包含 *. 的文件