Today, I messed around with my Linux system and wanted to see which applications were installed under the root user. It’s kind of like checking what superpowers your system has when logged in as the big boss.
Find out the current user
First, I used the whoami command. It’s a simple command, that tells you who you are logged in as. As I thought I was in as root, the output showed ‘root’.
Check installed applications
Next up, I needed to figure out how to list all the applications installed. I remembered that on Linux, especially on systems like Ubuntu, apt is the go-to guy for package management.
I initially tried using apt list –installed, which worked perfectly. It gave me a huge list of all installed packages. But then I thought, what if I wanted more details? That’s where aptitude comes in.
Get more detailed information
aptitude is like apt but on steroids. I don’t have aptitude, so I installed it with sudo apt-get install aptitude. It gives you more control and information. I ran a command like aptitude search ‘~i’ -F ‘%p %d’. This command searches for installed packages (‘~i’) and displays them in a format (-F) showing the package name (%p) and a short description (%d). It was pretty cool to see not just what was installed, but also a little bit about what each package does.
Explore other methods
I also did a little digging and found out that rpm is another way to check installed packages, especially on systems like Fedora or CentOS. The command rpm -qa does the trick there. It lists all queried packages.
Find where programs are installed
Sometimes, you just want to know where a program is hiding. That’s where whereis and which commands are useful. For example, whereis python showed me all the locations related to Python. And which python gave me the exact path to the Python executable I was using.
Conclusion
In the end, I found out that a bunch of applications were installed under root. Most of them were system tools and libraries that I don’t usually mess with directly. It was a good reminder that root has access to a lot of powerful stuff, and it’s important to be careful with what you install or run as root.
So that’s the story of my little adventure in the Linux world today. It’s always fun to poke around and see what’s under the hood of your system. But remember, with great power comes great responsibility, especially when you’re playing around as root!