How can I run notepad++.exe from terminal?

It's located under /home/jon/.wine/drive_c/Program Files/Notepad++/notepad++.exe but when I execute

sudo /home/jon/.wine/drive_c/Program Files/Notepad++/notepad++.exe

it returns

sudo: /home/jon/.wine/drive_c/Program: command not found
  • 2
    I have a question. Why would you want to run notepad++ under wine? Ubuntu has a large selection of excellent text editors. – Evan Kroske Oct 20 '10 at 0:07

If the file you are trying to create or edit does not require root privilege, run this:

wine /home/jon/.wine/drive_c/Program\ Files/Notepad++/notepad++.exe

If it does require root permission at all, install the notepad++ with your root account after having been logged in as root (e.g. by executing sudo -s -H), log out, and run:

sudo wine /home/root/.wine/drive_c/Program\ Files/Notepad++/notepad++.exe

But usually, as has been pointed out, running wine applications as root is not recommended since wine apps rely on wine and the source code of wine apps may or may not be reviewed, meaning there is an increased amount of risk involved in doing so.

| improve this answer | |
  • You can just use "wine /home/jon/...". sudo can be skipped as root privileges are normally not required for running wine apps. – W. Goeman Oct 19 '10 at 22:51
  • It depends. Perhaps the questioner wants to create and/or edit a file in the editor where root permission is needed. – Gödel Oct 19 '10 at 22:55
  • Thans. I can run it but if I omit sudo! I want to edit files but with sudo it says wine: /home/jon/.wine is not owned by you :( what should I do now? I am in full control of the computer and I have no problems running other stuff. – Jon Doe Oct 19 '10 at 23:07
  • @Jon Do this: $ sudo -s -H and then install notepad++ with the root account. You only installed notepad++ for user jon but not for root. – Gödel Oct 19 '10 at 23:10
  • 2
    @Gödel I think that he created .wine dir with root privileges and now he cannot run wine. I would chown the dir to the correct user or delete and recreate it. Running Wine as root is not recommended – Luca Oct 19 '10 at 23:41

Here are a generic ones:
(Just copy paste on Terminal, & press ENTER key)

For Ubuntu x64 OS:

wine /home/$USER/.wine/drive_c/Program\ Files\ \(x86\)/Notepad++/notepad++.exe

For Ubuntu x86 OS:

wine /home/$USER/.wine/drive_c/Program\ Files/Notepad++/notepad++.exe

If you dont know if your ubuntu is x86 or not, then type both above, one after the other, one will work.

Best of luck

| improve this answer | |

The space in the filename/path may be the main issue.

sudo /home/jon/.wine/drive_c/Program Files/Notepad++/notepad++.exe

should be:

sudo wine "/home/jon/.wine/drive_c/Program Files/Notepad++/notepad++.exe"

and I do believe you must tell wine what exe to run.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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