How to create a directory and set user permissions in Linux?

To create a directory and set user permissions in Linux, you can use the following command:

mkdir <目录名>  # 创建目录
chmod <权限> <目录名>  # 设置用户权限

To create a directory named testdir and set permissions for users to only read and execute, you can run the following command:

mkdir testdir
chmod 500 testdir

In this example, permission 500 means that the user has the permission to read and execute, but not to write.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds