menu search
brightness_auto
more_vert
What is the difference between chmod u+x and just chmod +x? I have seen a ton of tutorials that say to use u+x to make scripts executable. However, omitting the u doesn't seem to have any effect.
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
The man page of chmod covers that.

u stands for user.

g stands for group.

o stands for others.

a stands for all.

That means that chmod u+x somefile will grant only the owner of that file execution permissions whereas chmod +x somefile is the same as chmod a+x somefile.

The chmod man page says:

The format of a symbolic mode is [ugoa...][[+-=][rwxXstugo...]...][,...]. Multiple symbolic operations can be given, separated by commas.

A combination of the letters 'ugoa' controls which users' access to the file will be changed: the user who owns it (u), other users in the file's group (g), other users not in the file's group (o), or all users (a). If none of these are given, the effect is as if 'a' were given, but bits that are set in the umask are not affected.
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
eForumAfrica, where you can ask questions and receive answers from other members of the community. Find the answer to your question, help others by answering their questions.
...