From GUI this works: open file properties menu -> Permissions Tab -> check "Allow executing file as a program"
From terminal running chmod -x filename
doesn't do anything, nor outputs anything.
Things I've tried:
# 1
$ chown $USER filename
$ sudo chmod -x filename
# 2
$ sudo chmod -x filename
# 3
$ chmod -777 filename
Any ideas?
Thanks in advance :)
your command
chmod -x
deprives the execution permission. if you want to make it executable try:To check your permissions you can
cd
to the desired folder and then do als -l
, which will then display the permissions along with the filenames just like this:Here you can see there are a bunch of
.cpp
files which contain some C++ code , look at their permissions-rw-r--r--
which means they are can be read by everyone but can only be written by the owner. ThusAnd
d
means its a directory)Now you can add and remove permissions with
chmod
, where ,For example , as in your case to add the executable permission for the owner you can use the command
chmod u+x <filemane>
.Note : Using a
-
instead of a+
in the above command will remove that permission , for example to prevent others from reading you can use this command :chmod o-r <filename>