how to print the disks from lsblk in GIGA [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-2
down vote

favorite












how to print the disks from lsblk in GIGA



lsblk -io KNAME,TYPE,SIZE,MODEL

dm-0 lvm 50G
dm-1 lvm 16G
dm-2 lvm 100G
sdb disk 1.8T AVAGO
sdc disk 1.8T AVAGO
sdd disk 1.8T AVAGO
sde disk 1.8T AVAGO


we need to print all disks in GIGA



we have the option -b to print in byte but we prefer in giga










share|improve this question













closed as unclear what you're asking by Anthon, Jeff Schaller, sebasth, Stephen Rauch, Anthony Geoghegan Oct 2 '17 at 14:33


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 2




    What is GIGA? Do you mean gigabytes? Gigabit? Is that the same as giga?
    – Anthon
    Oct 2 '17 at 9:37














up vote
-2
down vote

favorite












how to print the disks from lsblk in GIGA



lsblk -io KNAME,TYPE,SIZE,MODEL

dm-0 lvm 50G
dm-1 lvm 16G
dm-2 lvm 100G
sdb disk 1.8T AVAGO
sdc disk 1.8T AVAGO
sdd disk 1.8T AVAGO
sde disk 1.8T AVAGO


we need to print all disks in GIGA



we have the option -b to print in byte but we prefer in giga










share|improve this question













closed as unclear what you're asking by Anthon, Jeff Schaller, sebasth, Stephen Rauch, Anthony Geoghegan Oct 2 '17 at 14:33


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 2




    What is GIGA? Do you mean gigabytes? Gigabit? Is that the same as giga?
    – Anthon
    Oct 2 '17 at 9:37












up vote
-2
down vote

favorite









up vote
-2
down vote

favorite











how to print the disks from lsblk in GIGA



lsblk -io KNAME,TYPE,SIZE,MODEL

dm-0 lvm 50G
dm-1 lvm 16G
dm-2 lvm 100G
sdb disk 1.8T AVAGO
sdc disk 1.8T AVAGO
sdd disk 1.8T AVAGO
sde disk 1.8T AVAGO


we need to print all disks in GIGA



we have the option -b to print in byte but we prefer in giga










share|improve this question













how to print the disks from lsblk in GIGA



lsblk -io KNAME,TYPE,SIZE,MODEL

dm-0 lvm 50G
dm-1 lvm 16G
dm-2 lvm 100G
sdb disk 1.8T AVAGO
sdc disk 1.8T AVAGO
sdd disk 1.8T AVAGO
sde disk 1.8T AVAGO


we need to print all disks in GIGA



we have the option -b to print in byte but we prefer in giga







linux filesystems rhel disk lsblk






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 2 '17 at 7:34









jango

11528




11528




closed as unclear what you're asking by Anthon, Jeff Schaller, sebasth, Stephen Rauch, Anthony Geoghegan Oct 2 '17 at 14:33


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by Anthon, Jeff Schaller, sebasth, Stephen Rauch, Anthony Geoghegan Oct 2 '17 at 14:33


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 2




    What is GIGA? Do you mean gigabytes? Gigabit? Is that the same as giga?
    – Anthon
    Oct 2 '17 at 9:37












  • 2




    What is GIGA? Do you mean gigabytes? Gigabit? Is that the same as giga?
    – Anthon
    Oct 2 '17 at 9:37







2




2




What is GIGA? Do you mean gigabytes? Gigabit? Is that the same as giga?
– Anthon
Oct 2 '17 at 9:37




What is GIGA? Do you mean gigabytes? Gigabit? Is that the same as giga?
– Anthon
Oct 2 '17 at 9:37










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Try this:



lsblk -b -io KNAME,TYPE,SIZE,MODEL | awk 'BEGINOFS="t" if (FNR>1) print $1,$2,$3/1073741824"G",$4; else print $0'





share|improve this answer



























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    Try this:



    lsblk -b -io KNAME,TYPE,SIZE,MODEL | awk 'BEGINOFS="t" if (FNR>1) print $1,$2,$3/1073741824"G",$4; else print $0'





    share|improve this answer
























      up vote
      0
      down vote



      accepted










      Try this:



      lsblk -b -io KNAME,TYPE,SIZE,MODEL | awk 'BEGINOFS="t" if (FNR>1) print $1,$2,$3/1073741824"G",$4; else print $0'





      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        Try this:



        lsblk -b -io KNAME,TYPE,SIZE,MODEL | awk 'BEGINOFS="t" if (FNR>1) print $1,$2,$3/1073741824"G",$4; else print $0'





        share|improve this answer












        Try this:



        lsblk -b -io KNAME,TYPE,SIZE,MODEL | awk 'BEGINOFS="t" if (FNR>1) print $1,$2,$3/1073741824"G",$4; else print $0'






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 2 '17 at 9:09









        Egor Vasilyev

        1,792129




        1,792129












            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay