正确使用mkdir -m -p和chown在一起 [英] Using mkdir -m -p and chown together correctly

查看:183
本文介绍了正确使用mkdir -m -p和chown在一起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用bash脚本创建目录,然后同时将模式设置为00755

I would like to create a directory using a bash script and then set the mode to 00755 at the same time

mkdir -p -m=00755 "/dir/dir2"

这是一起使用它们的正确方法吗?在创建它们时是否还可以在同一行中添加chown命令?

Is this the correct way of using them together and can I also add chown command to the same line while creating them?

推荐答案

它有点像这样:

install -d -m 0755 -o someuser -g somegroup /dir/dir2

这篇关于正确使用mkdir -m -p和chown在一起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆