I know, I just can hit Super+A to see all installed apps in Ubuntu, but I need a command to list their names. The command
dpkg --get-selections | awk '{print $1}'
is also not an option because it shows all installed packages and it contains drivers, kernels and libraries.
I came up with this answer for people who wants to use bash in a good way. It's clear that the answer of the question is related to the listing of the files from
/usr/share/applications
, but the problem is thatls
command shouldn't be parsed ever. In the past, I was doing the same mistake, but now I learned that the best way is to use afor
loop to iterate over the files, even if I must use some more keys from my precious keyboard:I also used in the previous command string manipulation operations: removed from
app
first 24 characters which are/usr/share/applications/
and last 8 characters which are.desktop
.Update:
Another place where you can find applications shown by the Dash is
~/.local/share/applications/*.desktop
. So you need to run the following command as well:To unify the previous two commands, you can use:
To get the list of all your installed applications with their names, the easiest way is to do:
It will get you a nice list of all installed packages that are not libraries, not kernels, not development package like this:
It's more complete since it also lists non-GUI applications that won't appear in the
.desktop
filesRun the below command to see all the installed applications,
If you want to get the list of all installed applications, then run the below command,
It will stores the above command output to
applications.txt
file inside your~/Desktop
directory.OR
Also run the below command on terminal to list the installed applications,
To get the list in text file, run the below command
Desktop entries for all the installed applications are stored inside
/usr/share/applications
directory, where file names are in the format ofapplication-name.desktop
.Removing the.desktop
part from the file names will give you the total list of installed applications.Update:
As @Radu suggested, you can also find desktop entries for your additional installed applications inside
~/.local/share/applications
directory.Not sure why most of the answers posted involves extracting the filename of .desktop shortcuts. Your .desktop shortcut filename can be anything but what matters is the
Name
field inside the shortcut file. If you want to build the list of installed application names showing in Dash, just "grep" that field under[Desktop Entry]
Rudimental code, with bash
But this does not take into account shortcuts that are hidden from being showed in Dash. Someone with better understand of .desktop spec might want to further expand this code to exclude those kinda of shortcuts
Edit : another attempt, with Python
If you need list of applications shown when you hit Super+A, you can use
ls /usr/share/applications
. The only thing you should do is replace.desktop
ending which is quite simple task. I do it withsed
:But you can do it after you received the list using the text editor.
The questioner wants to list the names of all installed "apps".
Regarding apps with .desktop files:
/usr/share/applications
~/.local/share/applications
Name=
line in the respective .desktop file. One example is "Character Map".Exec=
. In the case of "Character Map", that would begucharmap
.sed -ns '1F;/^\[Desktop Entry\]/,/^\[/{/^Name=/p;/^Exec=/h};${z;x;G;p}' /usr/share/applications/*.desktop
sed -ns '1F;/^\[Desktop Entry\]/,/^\[/{/^Name=/p;/^Exec=/h};${z;x;G;p}' $HOME/.local/share/applications/*.desktop
Regarding apps without .desktop files:
Depending on how one defines "app", some don't have .desktop files.
conky
,poppler-utils
,qpdf
,xdotool
andwmctrl
be considered "apps"? How are these to be identified and listed by their names (assuming one has installed them)?awk
,find
,grep
,ls
andsed
to name some more? Are they apps or are they not?If anything that has a command is thought of as an app, then Linux command to list all available commands and aliases and this answer there will help identify them.