Big-Rich
Posts: 3
Joined: Sat Mar 21, 2015 6:42 pm
Location: Portsmouth, UK
Contact: Website

Making files executable

Sat Mar 21, 2015 6:52 pm

Hi a complete noob here.

I have done a quick check and not turned up anything so here goes,

I'm trying to set up the VNC thing, i followed the instructions on the site untill i got to the part where it say's "Make the file executable" or something like that, i did a quick serch and it said to right click the file go to permissions and that's where i can't find the box to make it executable.

What am i doing wrong. If you can help i would be very grateful :)

User avatar
xoopha
Posts: 106
Joined: Mon Feb 09, 2015 9:52 pm

Re: Making files executable

Sat Mar 21, 2015 7:22 pm

In a terminal window: sudo chmod +x filename

Big-Rich
Posts: 3
Joined: Sat Mar 21, 2015 6:42 pm
Location: Portsmouth, UK
Contact: Website

Re: Making files executable

Sun Mar 22, 2015 5:47 pm

Thanks for your reply xoopha, still no joy i`m getting this when i do what you have said,

"chmod: cannot access `vnc.sh': No such file or directory"

Does it make any difference that i have the file on my desktop?

User avatar
rpdom
Posts: 13564
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Making files executable

Sun Mar 22, 2015 5:52 pm

Try

Code: Select all

chmod +x Desktop/vnc.sh

Big-Rich
Posts: 3
Joined: Sat Mar 21, 2015 6:42 pm
Location: Portsmouth, UK
Contact: Website

Re: Making files executable

Sun Mar 22, 2015 6:00 pm

Thanks rpdom, it's put me on the right track i finaly did sudo chmod +x Desktop/VNC.sh and it didn't return an error now :)

Mark_T
Posts: 149
Joined: Sat Dec 27, 2014 10:54 am

Re: Making files executable

Mon Mar 23, 2015 12:18 pm

There's nothing special about chmod, you always need to name a file correctly to refer to it,
so if its not in the current directory you'll have to give a relative or absolute path, or else
cd to the relevant directory.

If you want to see the permissions of files use "ls -l"

Code: Select all

ls -l Desktop/VNC.sh
The r,w,x flags mean read, write and execute. The three groups are for owner, group, world,
so -rwxrw-r-- means read/write/execute for the file's owner, read/write for file's group members
and only read for the rest of the world (other users). Root always has all privileges.

genodesiful
Posts: 11
Joined: Fri Jul 20, 2018 9:49 pm

Re: Making files executable

Sun Dec 09, 2018 2:50 pm

I know this is an ancient thread, but I thought someone in the future might find it useful.

You can't chmod +x a file with a space in the title. Push the words together and use standard practice of capitalising new words i.e screenOff and not screen off

n67
Posts: 939
Joined: Mon Oct 30, 2017 4:55 pm

Re: Making files executable

Sun Dec 09, 2018 2:58 pm

genodesiful wrote:
Sun Dec 09, 2018 2:50 pm
I know this is an ancient thread, but I thought someone in the future might find it useful.

You can't chmod +x a file with a space in the title. Push the words together and use standard practice of capitalising new words i.e screenOff and not screen off
Of course you can. You just have to quote it - just like with any other command.

$ chmod +x "File Name With spaces in it"
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
thagrol
Posts: 1290
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Making files executable

Sun Dec 09, 2018 6:09 pm

or

Code: Select all

chmod +x file\ name\ with\ in\ it
What you can't do is chmod a file you don't have write permission on.
Note to self: don't feed the trolls

If I've asked you a question, please answer it. I'm unlikely to be able to help without that information.

Return to “Beginners”