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: 17737
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: 18
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: 938
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: 3776
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.
Arguing with strangers on the internet since 1993.

BinTechLLC
Posts: 2
Joined: Thu Oct 10, 2019 8:37 am

Re: Making files executable

Thu Oct 10, 2019 9:25 am

I know this post is 7 years old at the time I am posting this but I am having this issue again after updating to the latest Raspbian / Buster version. I have no spaces in the file name, I have -rwxrwxrwx permissions on the file, I have done the same commands on the desktop icon that also has no spaces, but when I click the icon, it still shows the pop up. I used cd to go to the absolute directory before executing the commands. I did this separately for the main file and the desktop icon. I have also included #!/usr/bin/env python3.7 to the top of the document as well. Everything is updates as well at the time of this post. I have also looked into the option of right clicking on the file, going to permissions, and selecting the "Mark as executable" but that does not exist there. Any suggestions?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27461
Joined: Sat Jul 30, 2011 7:41 pm

Re: Making files executable

Thu Oct 10, 2019 10:14 am

BinTechLLC wrote:
Thu Oct 10, 2019 9:25 am
I know this post is 7 years old at the time I am posting this but I am having this issue again after updating to the latest Raspbian / Buster version. I have no spaces in the file name, I have -rwxrwxrwx permissions on the file, I have done the same commands on the desktop icon that also has no spaces, but when I click the icon, it still shows the pop up. I used cd to go to the absolute directory before executing the commands. I did this separately for the main file and the desktop icon. I have also included #!/usr/bin/env python3.7 to the top of the document as well. Everything is updates as well at the time of this post. I have also looked into the option of right clicking on the file, going to permissions, and selecting the "Mark as executable" but that does not exist there. Any suggestions?
Please start a new post, necroing threads never works.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Return to “Beginners”