我正在运行 lubuntu 20.04。
在 /etc/fstab 中,我挂载了我的 Debian-home 文件系统,并从该文件系统中绑定了一个文件夹。
cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=a19641aa-75ea-4815-b7c3-ce4c0a3cd0c9 / ext4 defaults,discard 0 1
UUID=3bbf1ad8-b0d0-464e-a73b-9337e16d95d0 /home ext4 defaults 0 2
UUID=927f38a0-c962-47de-9361-f1730032704e swap swap defaults 0 2
# Debian-home einbinden # my debian $HOME filesystem
UUID=1ebf0f02-cdd8-44d9-80f9-7078de79e191 /media/debian-home-partition ext4 user,auto 0 2
# einzelne Ordner einbinden von debian-home # folder with Videos
/media/debian-home-partition/alex/jd2 /home/alex/jd2 none bind,defaults 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
debian 和 ubuntu 中的用户名和 (id/gid) 相同。我可以将 ubuntu $HOME 中的 mv 或 cp 文件绑定到文件夹。
但不知何故 find 不起作用。
find jd2/downloads/ -name Xemnas
没有什么。
但
ls -al jd2/downloads/ | grep -i xemnas
-rw-rw-r-- 1 alex alex 305670178 Dez 31 16:18 Kingdom Hearts 3 ReMind - Roxas, Axel, Xion vs Xemnas Boss Fight (PS4 Pro) (4K) (60FPS)-AQofRl7z2u8.mp4
尝试一点调试
LANG=C
alex@Guilmon:~$ find -D tree jd2/downloads/ -name xemnas
Predicate List:
[(] [-name] [)] [-a] [-print]
Eval Tree:
pred=[-a] type=bi_op prec=and cost=Unknown est_success_rate=0,1000 no side effects
left:
pred=[-name xemnas] type=primary prec=no cost=Unknown est_success_rate=0,1000 no side effects
no children.
right:
pred=[-print] type=primary prec=no cost=Unknown est_success_rate=1,000 side effects
no children.
Normalized Eval Tree:
pred=[-a] type=bi_op prec=and cost=Nothing est_success_rate=0,1000 no side effects
left:
pred=[-a] type=bi_op prec=and cost=Nothing est_success_rate=0,1000 no side effects
no left.
right:
pred=[-name xemnas] type=primary prec=no cost=Nothing est_success_rate=0,1000 no side effects
no children.
right:
pred=[-print] type=primary prec=no cost=Nothing est_success_rate=1,000 side effects
no children.
Optimized Eval Tree:
pred=[-a] type=bi_op prec=and cost=Nothing est_success_rate=0,1000 no side effects
left:
pred=[-a] type=bi_op prec=and cost=Nothing est_success_rate=0,1000 no side effects
no left.
right:
pred=[-name xemnas] type=primary prec=no cost=Nothing est_success_rate=0,1000 no side effects
no children.
right:
pred=[-print] type=primary prec=no cost=Nothing est_success_rate=1,000 side effects
no children.
Optimized command line:
-name xemnas [est success rate 0,1] -a [est success rate 0,1] -print [est success rate 1]
我的绑定安装不正确吗?还是我通过 find 命令监督了某些事情?
命令
只会匹配名称完全正确的文件
xemnas
- 等同于您ls ... | grep -i xemnas
需要的命令其中
*
s 是匹配零个或多个前导/尾随字符的全局通配符,-iname
并使匹配不区分大小写。对于您的特定情况,您还可以使用使最初的 X 不区分大小写-name '*[Xx]emnas*'