• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / Using Linux Terminal How To Get Total Disk Size In GB

Using Linux Terminal How To Get Total Disk Size In GB

By Sourabh / September 23, 2026 Category: How To, Ubuntu

Using Linux Terminal command here is how to get total disk size in GB to check storage space in terminal.

Here are the commands to check disk space in Ubuntu.

df Command

The “df” command is for “disk filesystem” and is a great tool to know about the disk space usage on Linux Systems. The df command displays the amount of disk space available on the file system. If no file name is given, the space available on all currently mounted file systems is shown.

When executed in its simplest form (without any command potions), the df command displays the information about the file system disk space usage – device name, total blocks, total disk space, used disk space, free disk space and mount points.

df

As the disk space is shown in 1K blocks by default, users can use “-h” command parameter to show the file system disk space usage data in “human readable” format.

df -h

-h is human readable format. It appends a size letter to each size, such as ‘M’ for mebibytes. Powers of 1024 are used, not 1000; ‘M’ stands for 1,048,576 bytes. This option is equivalent to ‘–block-size=human-readable’.

du Command

‘du’ reports the amount of disk space used by the set of specified files and for each subdirectory (of directory arguments). With no arguments, ‘du’ reports the disk space for the current directory. Normally the disk space is printed in units of 1024 bytes, but this can be overridden.

There are many options for the du command. Here are some of the common ones:

  • -a – write counts for all files and not just directories
  • –apparent-size – prints apparent sizes rather than disk usage
  • -h – human-readable format
  • -b – bytes
  • -c -grand total
  • -k – block size
  • -m – size in megabytes
  1. Display all files: Use the command du -a to see all files and the directories.
  2. Display specific folder: Use the command du -a with the path to the directory. For example, to see the contents of my Downloads directory, I would run the command du -a /home/don/Downloads to see the contents of Downloads directory.
  3. Display size in human readable format: To display the disk usage or disk space in human readable format; in Gb, run the command with -h parameter (see above).

You can also use the lsblk command. The lsblk command lists block devices in a tree-like visual layout. It’s quite helpful if a user wants to see the actual hardware disks and their physical partitions, not just the mounted filesystems.

It gives an overall view of the real disk structure, including disks without active mounts, and their partitioning.

Primary Sidebar

Latest Posts

Count And Find Number Of Files In A Linux Directory Using Command

Check How Many Users Are Created In Linux Ubuntu

How To Check User Permissions In Linux Using Command

Check Which Folder Is Taking More Space In Ubuntu Linux

How to Install Claude Desktop App in Ubuntu Linux

Job Scheduling Using At Command In Linux With Examples

How To Check Permissions Of A Directory In Linux Command

Delete Directory And Contents Recursively Without Prompt On Linux

Check User Login History In Ubuntu Linux Command Line

Use Locate Command To Find File In Linux Terminal By Name

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap