linux chmod+x

您所在的位置:网站首页 group命令有什么作用 linux chmod+x

linux chmod+x

2024-03-08 10:40| 来源: 网络整理| 查看: 265

linux chmod+x

linux chmod+x

chmod  is very useful tool to manage file modes like read write execute. One of the most used option for chmod is +x which stands for execution rights. In this tutorial we will look different use cases for user or owner, group and others roles.

chmod是用于管理文件模式(如读写执行)的非常有用的工具。 chmod最常用的选项之一是+x ,代表执行权限。 在本教程中,我们将介绍用户或所有者,组和其他角色的不同用例。

列出当前用户和文件组 (List Current User and Group Of A File)

We generally need to know given file current user and group. We will use ls  command with -al options in order to list this information.

我们通常需要知道给定文件的当前用户和组。 我们将使用带有-al选项的ls命令以列出此信息。

$ ls -al app.sh List Current User and Group Of A File List Current User and Group Of A File 列出当前用户和文件组 更改用户的文件模式(Change File Mode For The User)

We can use u user before the plus in order to enable user execution right of the given file. In this example we will enable user execution of file app.sh

我们可以在加号之前使用u user,以启用给定文件的用户执行权。 在此示例中,我们将允许用户执行文件app.sh

$ chmod u+x app.sh 更改组的文件模式 (Change File Mode For Group)

We can use g group before the plus in order to enable group execution right of the given file. In this examples we will enable group execution of file app.sh

我们可以在加号之前使用g组,以启用给定文件的组执行权。 在此示例中,我们将启用文件app.sh组执行

$ chmod g+x app.sh 更改其他文件模式 (Change File Mode For Other)

Others is special group which covers all users in a Linux system. We can enable the execution right of the all users in a file with o like below.

其他是专门的小组,涵盖Linux系统中的所有用户。 我们可以使用如下所示的o启用文件中所有用户的执行权。

$ chmod o+x app.sh 更改所有人的文件模式 (Change File Mode For All)

In some cases we can see the +x  without a definition. This is used for all which is equivalent for user , group and others . Alternative is adding a like below.

在某些情况下,我们可以看到没有定义的+x 。 这用于所有与user , group和others等效的东西。 另a是在下面添加a类似。

$ chmod a+x app.sh

OR

要么

$ chmod +x app.sh LEARN MORE  How To Add Existing User To A Group In Ubuntu? 了解更多如何在Ubuntu中将现有用户添加到组中?

翻译自: https://www.poftut.com/chmod-x-command-linux-unix/

linux chmod+x



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3