254

Which commands will give me information about following using Terminal?

  1. Kernel Version
  2. Distribution version no.
  3. All partition size of the HDD
  • 4
    hostnamectl status will show -kernal version and distribution – user441517 Jan 1 '16 at 21:20
  • @user44517. that command was not present in 2012. – Ketan Patel Aug 31 '18 at 20:28
343
  • uname -a for all information regarding the kernel version,

    uname -r for the exact kernel version

  • lsb_release -afor all information related to the Ubuntu version,

    lsb_release -r for the exact version

  • sudo fdisk -l for partition information with all details.

    For more understandable information regarding paritions, please use commands given in other answers.

  • 1
    Not correct uname -a return all not just kernel version also lsb_release -a return all not only Ubuntu version moreover sudo fdisk -l return the block numbers and size and not human readable information – Maythux Mar 6 '14 at 15:01
  • It's a great answer, however, instead of all the information (-a option switch used in Web-E's answer) you can just get the specific numbers. This is much less confusing for a beginner - For this reason I prefer MrVaykadji and Hadi improvements. – not a patch Apr 14 '14 at 10:02
  • Can you provide some sample output of those commands (and the conclusion based on that sample output)? – Peter Mortensen May 29 '15 at 14:22
35

Kernel Version

cat /proc/version             # detail about for the kernel image version

Distribution Version

lsb_release -a

Partition Sizes

cat /proc/partitions          # for basic sizes
sudo fdisk -l /dev/<device>   # eg /dev/sda
  • Can you provide some sample output of those commands (and the conclusion based on that sample output)? – Peter Mortensen May 29 '15 at 14:22
  • +1 for the cat /proc/version – Oren S Apr 22 '17 at 18:15
18

Commands:

  • Kernel Version:

    uname -r
    
  • Distribution version number:

    lsb_release -sr
    
  • All partition sizes of the HDD in Terminal:

    lsblk -o NAME,SIZE
    

Example:

example

  • 2
    what terminal is that? how did you get that triangle? – NullVoxPopuli Aug 17 '14 at 16:16
  • 1
    it's a bashrc modification with default unity terminal. The triangle is in the characters table. – MrVaykadji Feb 14 '15 at 8:18
8

Kernel version is:

uname -r

Ubuntu release version is:

lsb_release -r

All partition size of the HDD in Terminal

df -ht ext4

replace ext4 with your FS type if it's not so


With respect to the marked as answer post:

Not correct uname -a return all not just kernel version also lsb_release -a return all not only Ubuntu version moreover sudo fdisk -l return the block numbers and size and not human readable information

5

Open terminal. Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo fdisk -l; uname -a; lsb_release -a
4

uname -r

sudo fdisk -l

lsb_release -a

0

To find the exact distribution, that is Ubuntu 16.04.1 or Ubuntu 16.04.3 you would use

lsb_release -d

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.