同时移动文件和更改权限

发布于 2024-12-21 07:38:35 字数 68 浏览 3 评论 0原文

在Linux中,当我使用mv时,新文件保留相同的权限。我想 mv 一个文件,但在移动之后,由新文件的所有者进行。这可能吗?

In Linux, when I use mv, the new file retains the same permissions. I would like to mv a file, but after the move, by the owner of the new file. Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

白衬杉格子梦 2024-12-28 07:38:35

同时是什么意思?为什么它很重要?这对你有用吗?

对于权限:

mv $old $new; chmod xyz $new 

对于所有者:

mv $old $new; chown user:user $new

What do you mean by simultaneous and why does it matter? Would this work for you?

For permissions:

mv $old $new; chmod xyz $new 

For owner:

mv $old $new; chown user:user $new
淡淡の花香 2024-12-28 07:38:35

您可以在同一终端行中 mv 然后 chown 该文件。请参阅按顺序执行多个命令

You can mv and then chown the file in the same terminal line. See Executing multiple command in sequence.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文