Saturday, May 18, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 7263  / 1 Year ago, mon, december 26, 2022, 4:36:42

I installed Viber on Ubuntu:



/home/nazar/Software/Viber/Viber.sh


I can run it from terminal specifying this path. I want to achieve some short command as:



viber


For lunching application.



How to solve this issue?


More From » command-line

 Answers
5

You can create an alias of the full command by running the following in the terminal:



alias viber=/home/nazar/Software/Viber/Viber.sh


Now you can run the script by just typing viber.



Note that this will be working for the current session of the shell only. To make it permanent save it in ~/.bash_aliases (or ~/.bashrc):



$ echo 'alias viber=/home/nazar/Software/Viber/Viber.sh' >> ~/.bash_aliases
$ source ~/.bash_aliases


The first command will save the alias permanently in ~/.bash_aliases, the preferred file to save aliases. It will create the file if not exists already. The second command will make the alias working from the current shell session.



An alternate method is to create a symbolic link of the executable script in the /usr/local/bin or /usr/bin directory(given they are in your PATH environment variable).



sudo ln -s /home/nazar/Software/Viber/Viber.sh /usr/local/bin/viber


As the directory is owned by user root and group root, make sure /usr/local/bin/viber has execute permission for all others (a+x).



By using any one of the above methods, you can run the script by simply typing viber.


[#20264] Tuesday, December 27, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
otputler

Total Points: 53
Total Questions: 105
Total Answers: 93

Location: Zimbabwe
Member since Wed, Nov 9, 2022
2 Years ago
;