Linux: Difference between "chmod +x" and "chmod u+x"
Question by Guest | Last update on 2023-02-17 | Created on 2016-07-23
At the moment, I am working with batch scripts on Linux for the first time. I have already created a file containing my script and I also know how to mark this file as executable in order to make it runable.
However, I have seen several different ways and procedures to do that on the Internet. In one tutorial, they say that you have to use "chmod +x", on another website "chmod u+x" is mentioned.
I have tried both and obviously there is no difference. Both methods are working in the same way. Or is there any difference? What should I use better? Should I prefer one way?
Related Topics
Linux: Mark Program File as executable
Tutorial | 0 Comments
Release of Debian Packages, RPM Packages and Binaries for Linux
Blog | 0 Comments
Linux: chmod +x possible via GUI?
Question | 1 Answer
Linux: Program file not found although existing (No such file or directory)
Question | 1 Answer
Lazarus: Detect Operating System (Compiler Switch)
Tutorial | 0 Comments
Change Date of File
Tutorial | 0 Comments
Micro SD Memory Cards: Difference between microSD, microSDHC, microSDXC and microSDUC
Info | 12 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
The "u" is standing for "user". That means that the executable flag only applies to the current user of the file.
The following is possible:
If you only write "chmod +x", this is the same as "chmod a+x" - the modification applies to all.
However, it is also possible to combine multiple letters, for example "chmod ugo-x" or "chmod ug-x" for the owner of the file as well as the other users of the file group.
By the way, with "chmod -x" you can abolish the executability again. The minus sign removes the flags, the plus sign adds them.
Last update on 2023-02-17 | Created on 2016-07-23