Learning Linux Command is not as easy as eating coke and drinking peanut

Linux Command Changing Mode Help

chmod --help

Permissions
u - User who owns the file.
g - Group that owns the file.
o - Other.
a - All.
r - Read the file.
w - Write or edit the file.
x - Execute or run the file as a program

We’d like to remove write permission for the group and others on wordmatic, and add write and execute permission for all users on calcmatic.

Rather than try to figure out what the new permissions are and do these commands:

chmod go=rxwordmatic
chmod a=rwxcalcmatic

The chmod command literally lets us add and subtract permissions from an existing set by using + or - instead of =.
Thus, we can take away the first file’s write permission for the group and others with this command:

chmod go-w wordmatic

...and we can add write and execute permission to the second file for all users with:

chmoda+wxcalcmatic

0 comments:

Post a Comment