version: display Linux version information
One thing I find myself always having to look up is how to display version information in Linux. That’s because the commands for displaying version information are in no way intuitive or memorable.
Specifically, if you want to display information about your distribution, including its version, you have to use the
lsb_release command1. And to see the Linux kernel version, you have to remember to enter
Why? Because fuck you, that’s why.
I guess it was just too damn hard to create a version command or script. Thankfully, using my uber niche koding skillz, I was able to come up with one after literally seconds of hard work:
Create the following script in your text editor of choice and save it in a file called version somewhere that’s on your system’s execution path (I put it in
#!/bin/sh echo "\nOperating system:\n" lsb_release -i lsb_release -d lsb_release -r lsb_release -c echo "\nLinux kernel:\n" uname -r echo ""
Make the script executable:
sudo chmod +x /usr/local/bin/version
In Terminal, run
You should see output similar to the following that displays information about your distribution and kernel versions:
Operating system: Distributor ID: Ubuntu Description: Pop!_OS 18.10 Release: 18.10 Codename: cosmic Linux kernel: 4.18.0-10-generic
LSB stands for ‘Linux Standard Base’. Don’t you feel smarter now? ↩︎