- Published on
Commands for listing metadata in Linux (or Unix ?) based operating systems
Introduction
When you start using any Linux based operating system, one of the first commands you may come across are cd
, mkdir
and ls
just to name a few (of course, I use fish so I hardly ever type cd
in my commands). I recently pressed Tab
(by mistake of course) after typing out ls
and I found out that I there's more to listing out stuff than I realised.

Of course, most of us will probably go six feet under without ever typing out this commands manually because of the GUI. As developers though, we don't live in the fortunate world of clickable buttons and have to waddle our way in an arcane shell prompt to achieve maximum productivity and understand hopw stuff works under the hood.
I'm obviously NOT going to go through every command but will just go over a few that I found potentially useful in my workflow.
You can also run
man
against the command you want to know more about since all the commands have switches to alter their behaviour.
lscpu
This command is useful if you're doing things like building apps from source (and maybe you don't know what machine architecture you're running on) or want to know the nitty gritty details of your CPU.
As an added bonus you can even get the output in JSON format using the -J
switch and redirect the output to a file for future reference.

lslogins
Obviously, most of us are usually the only one logged onto their system but this command does give you insight of a lot of metadata about the services logged on top your system whicch can be useful if your debugging or trying to figure out performance bottlenecks on your system.
lsusb
This command is helpful if you want to get the devices connected to your USB ports without opening a graphical file manager (ewww 🤮).

Conclusion
I left out a lot of commands because this isn't a tutorial and some of the other commands are for more hardcore edge cases which you should just run on your machine and see the output. You'd be surprised how a few good commands can improve your workflow.