Issue
Hi i am currently trying to set keywords for my terminal to launch some software without having to type the whole path.
For exemple:
firefox
#instead of
/home/debian/firefox/firefox
I always do this kind of thing on windows by setting path in the environment variable manager.
After i read this post PATH environment variable in linux , i added this line to the etc/environment file:
export firefox=/home/debian/firefox/firefox
#I also tried this:
export PATH=$PATH:/home/debian/firefox
It doesn't work, can someone explains me how to do this?
Solution
I would setup a new alias in my .bashrc
or .profile
, which should be located under your home directory. Add the following to the end of the file:
alias firefox="/home/debian/firefox/firefox"
Save the file and reload it using:
source ~/.bashrc
Since you added the alias to your .bashrc
this alias will be created everytime you open a new instance of a shell.
You could use nohup
to keep the command running after the shell session ends:
alias firefox="nohup /home/debian/firefox/firefox &"
Notice the trailing &
character, which will run the command in the background so you can keep using your terminal.
Answered By - Cyclonecode