#### List explicitly installed packages that are not in the base or base-devel groups
```comm -23 <(pacman -Qqe | sort) <(pacman -Qqg base base-devel | sort) | sort -n ```
#### Or the same with size and description, sorted by size:
```expac -H M "%011m\t%-20n\t%10d" $(comm -23 <(pacman -Qqe | sort) <(pacman -Qqg base base-devel | sort)) | sort -n ```
#### Note: I dropped -n from the Pacman options to include AUR packages.
#### List packages that are optional dependencies and not installed explicitly
```comm -13 <(pacman -Qdtq | sort) <(pacman -Qdttq | sort) ```
> Note: Run pacman -Qi <pkg> on any package in the output to see which package it is Optional For. If you run pacman -Qi <pkg> with those packages, too, you usually get a description of the functionality the optional dependency provides.
See also:
https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks
https://wiki.archlinux.org/index.php/System_maintenance
Slightly related: List packages by their install date
```expac --timefmt="%F %T" "%l %w %n" | grep explicit | cut -d ' ' -f 1-2,4- | sort -n```
#### This only lists the most recent install date. Not sure if this one is in the wiki.