What is the terminal command to set a file to -x flag? (- execute)

Hi!

What is the terminal command to set an file to -x flag? (- execute)

See picture @ Execute:
-x

When I run

sudo chmod -x "file-name" then it removed the "-" or "+" flag
on a file but which command can I restore the "-" flag on Execute - Allow executing file as program?

do you mean, sudo chmod +x file

no, that makes the file executable. (+ flag)

sudo chmod -x file makes it unexecutable. (no flag)
see here:
no_x

I need the command to set a file to - flag on the option

"Execute: Allow executing file as program"

see here:-x

In my system, I do not see a "-" flag

the checkbox is either blank (no exec permission)
image

or

the checkbox is green with a white checkmark (exec permission)
image

caja 1.24.0

hmm, very very strange.

I believe that the "-" appears for folders, indicating that files in the folder can be executable or not. Folders themselves are not executable. A file should have the field in the GUI either checked or not.

Remember permissions have 3 groups (owner-group-everyone I think they are). The chmod +x and -x sets and resets this x permission in all 3 of these groups.

Now take a typical file with 664 permissions rw-rw-r-- and change it to mixed execute:

chmod 674 file

...and Caja will describe this mixed condition best it can - with that "-". So the context of "-" being "not set" is not what it means.

Did this make sense?

For me, I need this, it's:

chmod 754 file

see here:
Screenshot at 2021-02-11 16-12-02