文件寄到主机的位置是什么?
我不小心将.thunderbird .thunderbird
到user@host
而不是user@host:/home/user
。
现在.thunderbird
在哪里? 有没有一个好方法来搜索文件夹?
它位于运行命令的目录中:
$ touch foo $ ls -l foo bar@baz ls: cannot access 'bar@baz': No such file or directory -rw-rw-r-- 1 muru muru 0 May 30 16:53 foo $ rsync -aP foo bar@baz sending incremental file list foo 0 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=0/1) $ ls -l foo bar -rw-rw-r-- 1 muru muru 0 May 30 16:53 bar@baz -rw-rw-r-- 1 muru muru 0 May 30 16:53 foo
如果您使用rsync .thunderbird user@host:
而不是rsync .thunderbird user@host
(注意:
rsync .thunderbird user@host
,那么该目录被复制到host
上user
的主目录(因此/home/user
通常在user@host:/home/user
是多余的) user@host:/home/user
)。 如果没有:
,则第二个参数只是本地系统上目标目录的路径。
这同样适用于scp
。
请注意, rsync
不会删除源文件,除非您告诉它。 所以.thunderbird
仍然在那里,并且无论复制到哪里都会制作新的副本。
另请注意, rsync
根据源目录是否具有尾随/
具有不同的行为。 这两个是不同的:
rsync -aP .thunderbird somewhere rsync -aP .thunderbird/ somewhere
在第一种情况下, .thunderbird
目录被复制somewhere
,但在第二种情况下, .thunderbird
的内容被复制(所以你不会看到somewhere/.thunderbird
,但如果有.thunderbird/foo
,你’ d看到somewhere/foo
而不是somewhere/.thunderbird/foo
)。