This answers the specific question "Is there any way to know in terminal name of applications without searching from the internet?" and "How to find out name of applications to remove it in termial". If you want to use that information to also remove it using the terminal, knowing the name of the executable that launches the program may not be enough.
For applications that are in your menu system, searching your system's .desktop
launchers is a good way. .desktop
launchers are little text files with the .desktop
extension, which are used to tell the operating system various things about an installed application.
You can find such launcher based on what is displayed in the menu. For example, the launcher for LO Writer will contain the string on a line starting with Name=
. When you open that launcher in a text editor, you will see the executable specified after Exec=
.
You can use any tool you want to search a file based on content, however, I have a little script, which I've named whichdesktop
, that searches .desktop
files:
Content of whichdesktop
:
#!/bin/bash
IFS=$" :"
DIR="$HOME/.local/share/applications"
for d in $XDG_DATA_DIRS; do
d=$(echo "$d" | sed -e 's/\/$//')
[ -d $d/applications ] && DIR="$DIR $d/applications"
done
find -L $DIR -name '*.desktop' -exec grep -H "$1" {} \;
It makes a list of the directories where .desktop
launchers may be installed, and then invokes find
to search only these directories.
For example, if I'm interested in finding what the executable for LibreOffice Writer is called, I run:
$ whichdesktop "LibreOffice Writer"
/usr/share/applications/libreoffice-writer.desktop:Name=LibreOffice Writer
$ cat /usr/share/applications/libreoffice-writer.desktop | grep Exec=
Exec=libreoffice --writer %U
Exec=libreoffice --writer
which tells that the executable is called libreoffice
.