Disable ads (and more) with a membership for a one time $4.99 payment
How do you add group write and execute permissions to myfile.txt in Linux?
chmod g-wx myfile.txt
chmod g+x myfile.txt
chmod g+wx myfile.txt
chmod u+wx myfile.txt
The correct answer is: chmod g+wx myfile.txt
In Linux, permissions can be assigned to a file for the file owner, groups, and everyone else. The chmod command is used to modify these permissions. Options can be combined to set multiple permissions simultaneously. In this scenario, the correct command to add group write and execute permissions to myfile.txt is "chmod g+wx myfile.txt". Option A, "chmod g-wx myfile.txt", would only remove group write and execute permissions, but not add them. Option B, "chmod g+x myfile.txt", would only add group execute permission, but not group write permission. Option D, "chmod u+wx myfile.txt", would add write and execute permissions for the file owner, not for the group.