How do I mark a file as executable on Xubuntu?
- Press Ctrl+Alt+T to open a terminal.
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 Properties → Permisions 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
Ben
Just a Xubuntu user that knows a small amount about terminals and is trying to learn.
Updated on September 18, 2022Comments
-
Ben over 1 year
I need to know how to mark a file as executable but the check box is not there.
-
Rinzwind over 10 yearsnext time include the system you use ;) Does this help: askubuntu.com/questions/321780/… ?
-
-
laurent over 10 yearsYou 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
-
Evgeny Danilenko over 10 yearsyes I know. But he barely knows how to make the file an executable (no offence). I only answered what he needed to know.
-
Ben over 10 yearsI 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.
-
laurent over 10 yearsSo 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/…