Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Nautilus and Thunar have a such context menu option under Properties/Permissions, but not PCManFM, Lubuntu's default file and desktop manager (at least not yet in the present v. 1.1.).

But under "Open with"/(again)"Open with"/"Custom command line", it is possible to add new custom commands.

enter image description here

enter image description here

This creates a file with extension .desktop in ~/.local/share/applications which can be edited further so as to get a proper name and icon.

What is the command to add in this way for making a file executable?

That is: how to use sudo chmod +x filename to make it work in this way?

share|improve this question
up vote 1 down vote accepted

The command sudo chmod +x must run in a terminal (gnome-terminal -e "sudo chmod +x %f") or alternatively the line Terminal=true should be in a desktop file in `/usr/share/applications/make_exec.desktop:

[Desktop Entry]
Name=Make file executable
Exec=sudo chmod +x %f 

To make an application to appear in the context menu, it has to have a desktop file in /usr/share/applications, but also you may need to edit as administrator /usr/share/applications/mimeinfo.cache and in the line of the intended file type to add the application.desktop.

So, in the present case, open /usr/share/applications/mimeinfo.cache and add make_exec.desktop to the line text/plain.

share|improve this answer

Your Answer


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.