Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need to know how to mark a file as executable but the check box is not there.

share|improve this question
2  
next time include the system you use ;) Does this help: askubuntu.com/questions/321780/… ? –  Rinzwind Sep 18 '13 at 14:31

2 Answers 2

  1. Press Ctrl+Alt+T to open a terminal.
  2. Navigate to the location of your file by inputting cd command into the terminal Eg. cd /documents/, then enter the following:

    chmod +x yourfilename
    

To view if your changes had been saved enter the following ls -l in the terminal.

Other way to change your file to an executable is to right click the file, select PropertiesPermisions and tick Allow execution of the file as a program.

Hope this helps. Also to execute the file you first have to be in the directory where it is located. For instance if your file is located in the Documents folder, you have to cd ("change directory") in to that directory and then do this: ./yourfile.c

This is how it will look:

root@root:~/Documents$ ./file.c
share|improve this answer
    
You don't need to CD to the directory of the file to execute it if the directory is on the PATH or if you include the full path when executing like ~/bin/file-to-execute –  laurent Sep 18 '13 at 15:39
    
yes I know. But he barely knows how to make the file an executable (no offence). I only answered what he needed to know. –  Evgeny Danilenko Sep 18 '13 at 15:44

As you say the checkbox is not there, I assume you are in the correct place to change it in Thunar so if the checkbox in Properties -> permissions is not there, it is because the file is not an executable file (if it is a script, did you include #!/bin/bash at the beginning?)

If the checkbox is there and you can't change it, it is because you are not alowed to change the file (not owner?).

share|improve this answer
    
I am logged in as the correct user. Also the file I am trying to do this on is a .jar. I am a complete noob at Xubuntu so if I cant quite understand some of the things you say I'm sorry. –  Ben Sep 18 '13 at 23:27
    
So this is why it can't be marked as executable as jar files are not executables directly. Have a look at this answer askubuntu.com/questions/321780/… –  laurent Sep 19 '13 at 6:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.