Ubuntu – How to mark a file as executable on Xubuntu


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

Best Answer

  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
Related Question