Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The question is that I want to toggle of the executable bit of a linux executable I know that I can set a+x executable, but I can't set is as NOT executable :( Google omits not from searches..

share|improve this question
up vote 3 down vote accepted

Just FYI.

CHMOD is used to change permissions of a file. PERMISSION COMMAND

     U   G   W
    rwx rwx rwx     chmod 777 filename      
    rwx rwx r-x     chmod 775 filename
    rwx r-x r-x     chmod 755 filename
    rw- rw- r--     chmod 664 filename
    rw- r-- r--     chmod 644 filename

    U = User 
    G = Group 
    W = World

    r = Readable
    w = writable
    x = executable 
    - = no permission

Here is another way of looking at it:


400     read by owner
040     read by group
004     read by anybody (other)
200     write by owner
020     write by group
002     write by anybody
100     execute by owner
010     execute by group
001     execute by anybody

To get a combination, just add them up. For example, to get read, write, execute by owner, read, execute, by group, and execute by anybody, you would add 400+200+100+040+010+001 to give 751.

share|improve this answer

Just like a+x adds execute, a-x removes it.

share|improve this answer

Easiest way without changing other settings: chmod -x file.

From man chmod:

           mode         ::= clause [, clause ...]
           clause       ::= [who ...] [action ...] action
           action       ::= op [perm ...]
           who          ::= a | u | g | o
           op           ::= + | - | =
           perm         ::= r | s | t | w | x | X | u | g | o

Notice the three options in op: +, - and =

share|improve this answer

Simply use: chmod -x <file>

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .