Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 然后查找ln,然后查找chown,然后查找chmod_Bash - Fatal编程技术网

Bash 然后查找ln,然后查找chown,然后查找chmod

Bash 然后查找ln,然后查找chown,然后查找chmod,bash,Bash,这就像我使用了更多的变量。我现在尝试在硬链接上创建user:user{},然后chmod 640{},所有这些都是在硬链接上创建的。但我尝试的似乎都不管用 find . -name "test" -exec ln {} /path/ \; 就像: find . -name "test" -exec ln {} /path/ | chown user:user /path/{} | chmod 640 /path/{} \; 不确定您想做什么,但据我所知,在*nix上不允许指向目录的硬链接,因

这就像我使用了更多的变量。我现在尝试在硬链接上创建user:user{},然后chmod 640{},所有这些都是在硬链接上创建的。但我尝试的似乎都不管用

find . -name "test" -exec ln {} /path/ \;
就像:

find . -name "test" -exec ln {} /path/ | chown user:user /path/{} | chmod 640 /path/{} \;

不确定您想做什么,但据我所知,在*nix上不允许指向目录的硬链接,因此我假设您想要一个符号链接,并且您似乎希望通过对所有权和权限更改进行编码的方式将链接放到/path中:


sudo find-name test-exec sh-cln-s/path//path/{};chown user:user/path/{};chmod 640/path/{}\

这个:找到-名称测试-exec ln{}/path/\-exec chown user:user/path/{}\-exec chmod 640/path/{}\;将仅从当前目录起作用。无论您是使用chmod/chown原始链接还是新链接,它们共享权限和所有者。@gniourf_gniourf我正在尝试查找,然后移动,然后更改权限。你有更好的办法吗?谢谢你的意见@那个家伙真的吗??嗯,这确实有道理。@DavidCuster比他们给你的工作命令更好吗?