How to run Telegram from Terminal
Solution 1
The app is installed in
/opt/telegram/
and the binary is
/opt/telegram/Telegram
To start the messenger via command line, you have to use the full path or add the path to your PATH definition or create a symbolic link in /usr/bin
:
-
Use the PATH
-
Edit the file
~/.profile
nano ~/.profile
-
and add the line below at the end of the file
export PATH="$PATH:/opt/telegram"
-
OR
-
Use a symbolic link
sudo ln -s /opt/telegram/Telegram /usr/local/bin
You have a desktop file:
/usr/share/applications/telegram.desktop
and therefore use the command below
cp /usr/share/applications/telegram.desktop ~/.config/autostart
to create an autostart entry via command line.
Why do I know that?
% dpkg -L telegram
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/telegram
/usr/share/doc/telegram/copyright
/usr/share/doc/telegram/changelog.Debian.gz
/usr/share/applications
/usr/share/applications/telegram.desktop
/opt
/opt/telegram
/opt/telegram/telegram.tar.xz
/opt/telegram/telegram.svg
% cat /usr/share/applications/telegram.desktop
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name=Telegram
Exec=/opt/telegram/Telegram
Comment=Network taking back our right to privacy.
Icon=/opt/telegram/telegram.svg
Categories=GNOME;GTK;Network;
Solution 2
If you installed using snap, try
telegram-desktop
Solution 3
Use a Bash alias like this:
alias tg='/opt/telegram/Telegram'
And then just type:
tg
in Terminal and it will open Telegram. You can replace tg
with what you like.
Related videos on Youtube
Michał Żywiecki
Updated on September 18, 2022Comments
-
Michał Żywiecki over 1 year
So I have telegram messenger on my Ubuntu and I'm trying to launch it from terminal and later on set it up as startup program - problem is I cannot find command to run it. telegram/Telegram don't work.
This is how I installed this app:
sudo add-apt-repository ppa:atareao/telegram sudo apt-get update sudo apt-get install telegram
Thank you for any help.
-
Michał Żywiecki over 8 yearsYes that do the trick :) - Thank you so much for support
-
Fabby over 8 yearsI like the "why do I know that" additions... ;-)
-
Zanna over 7 yearsSeems like a good answer to me
-
Olle Härstedt almost 6 yearsWhy the hell did they put it there instead of /usr/bin as all others?
-
Adam Goldman almost 5 yearsthis outputs:
Qt: Session management error: None of the authentication protocols specified are supported
, any ideas? -
Jackssn almost 3 yearsit works for my ubuntu 20.04