环境:SuSE 15 SP1 问题:奇怪的是,远程 ssh ls -l 无法输出一些最新的文件列表。
jchadb2:/scripts #
jchadb2:/scripts #
jchadb2:/scripts # ls -ltr /scripts/*.sh
-rwxr-xr-- 1 root root 1519 Dec 23 2019 /scripts/hacfg_trans_v2.sh
-rwxr-xr-- 1 root root 1519 Dec 23 2019 /scripts/hacfg_trans.sh
-rwxr--r-- 1 root root 1550 Dec 31 2019 /scripts/hafile_trans_dos.sh
-rwxr--r-- 1 root root 1516 Dec 31 2019 /scripts/hafile_trans_ux.sh
-rwxr--r-- 1 root root 1497 Dec 31 2019 /scripts/hafile_trans.sh
-rwxr-xr-- 1 root root 1523 Dec 30 18:34 /scripts/habak_trans_v2.sh
-rwxr--r-- 1 root root 1548 Dec 31 10:57 /scripts/hafile_trans_v2.sh
-rwxr-xr-- 1 root root 1622 Dec 31 16:30 /scripts/habak_trans_v3a.sh
-rwxr--r-- 1 root root 1647 Dec 31 17:18 /scripts/hafile_trans_v3a.sh
-rwxr--r-- 1 root root 1647 Dec 31 17:18 /scripts/hafile_trans_v3.sh
jchadb2:/scripts #
jchadb2:/scripts #
jchadb1:/scripts #
jchadb1:/scripts #
jchadb1:/scripts # ssh jchadb2 ls -l /scripts/*.sh
-rwxr-xr-- 1 root root 1476 Dec 11 2019 /scripts/habak_trans.sh
-rwxr-xr-- 1 root root 1519 Dec 23 2019 /scripts/hacfg_trans.sh
-rwxr--r-- 1 root root 1550 Dec 31 2019 /scripts/hafile_trans_dos.sh
-rwxr--r-- 1 root root 1516 Dec 31 2019 /scripts/hafile_trans_ux.sh
-rwxr--r-- 1 root root 1497 Dec 31 2019 /scripts/hafile_trans.sh
jchadb1:/scripts #
jchadb1:/scripts #
答案1
你有jchab1:/scripts
那场比赛的文件/scripts/*
所以
ssh jchadb2 ls -l /scripts/*.sh
首先,本地扩展至
ssh jchadb2 ls -l /scripts/habak_trans.sh .. (no _v2 files)
接下来,ls -l /scripts/habak_trans.sh ..
被发送到jchab2
(仍然没有 _v2. 文件)
在远程主机上,仅列出显式文件。
比较
ssh jchadb2 ls -l /scripts/*.sh
和
ssh jchadb2 ls -l /scripts/*_v*.sh
尝试逃避*
ssh jchadb2 ls -l /scripts/\*.sh