0

I can open my Arduino and Android Studio IDE irrespective of my current path by these commands

 ~/arduino/./arduino 
 ~/android/./studio

I've created aliases for both of them on my .bashrc file and its working fine.

I want to know if there is a more efficient way of solving this kind of problems?

ceving
  • 21,900
  • 13
  • 104
  • 178
ahhmarr
  • 2,296
  • 4
  • 27
  • 30

4 Answers4

0

~ represents you home directory in your system. That is why you can open those programs from anywhere. But, if you login as another user, this won't work as ~ would then represent to that user's home directory.

If you want you can replace ~ by /home/<yourUsername> (the absolute path to your home directory) or even /root depending upon your installation settings.

skrtbhtngr
  • 2,223
  • 23
  • 29
0

You can add folders to your users path variable in the .profile file in your home directory. (or .bash_profile if it exists, since bash will prefer that folder.)

See: https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path

Community
  • 1
  • 1
Stig Tore
  • 266
  • 1
  • 13
0

You have to update your PATH variable in your .bash_profile:

export PATH="$PATH:$HOME/arduino"

See here for an explanation of the differences between various Shell startup files.

Community
  • 1
  • 1
ceving
  • 21,900
  • 13
  • 104
  • 178
0

the answer given by ceving is good but incomplete, once added to your path, you can execute your file but you should not use the

./
extension. So finally you'll have to do:
 export PATH="/home/arduino:$PATH"

then just call your executable file:

 arduino
 studio 
Max Alonzo
  • 45
  • 5