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

I want to launch Intellij IDEA IDE via sudo sudo because IDE needs to manupulate files from /etc/share. is placed at /home/<username>/<path>/bin/

I tried to add this path to PATH environment variable by adding export PATH="$PATH":<path-to-idea>/bin to /etc/profile or by changing string in /etc/environment from PATH="blahblah" to PATH="<path-to-idea>/bin:blahblah". In both cases after sudo echo $PATH command I got string with my path to IDEA added.

But when I tried to execute via sudo I got sudo: command not found. What am I doing wrong?

share|improve this question
Try sudo -E to preserve your environment. You may get an error. – glenn jackman Feb 21 '14 at 23:04
the same result – kassie Feb 21 '14 at 23:10
sudo -i will do – user224465 Feb 21 '14 at 23:52
-bash: command not found – kassie Feb 21 '14 at 23:54
Easier to place the script in /usr/local/bin. – Gunnar Hjalmarsson Feb 22 '14 at 5:32

Just to run:

sudo ./

in background:

sudo ./ &

Also visit similar answer.

share|improve this answer
sudo: ./ command not found. – kassie Feb 22 '14 at 19:26

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.