Skip to content

Latest commit

 

History

History
61 lines (51 loc) · 1.35 KB

2018-04-09.md

File metadata and controls

61 lines (51 loc) · 1.35 KB

Check Disk Space in Linux

  • Check File System Disk Space Usage
df
  • Display Information of all File System Disk Space Usage
df -a
  • Show Disk Space Usage in Human Readable Format
df -h

https://www.tecmint.com/how-to-check-disk-space-in-linux/

Find Disk Usage of Files and Directories

  • To find out the disk usage summary of a /home/tecmint directory tree and each of its sub directories
du /home/tecmint
  • Using “-h” option with “du” command provides results in “Human Readable Format“. Means you can see sizes in Bytes, Kilobytes, Megabytes, Gigabytes
du -h /home/tecmint

https://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/

Manage Linux Disk Partitions

  • View all Disk Partitions in Linux
fdisk -l
  • View Specific Disk Partition in Linux
fdisk -l /dev/sda
  • Check all Available fdisk Commands
fdisk /dev/sda
  • Print all Partition Table in Linux
fdisk /dev/sda

From the command mode, enter ‘p‘ instead of ‘m‘ as we did earlier. As I enter ‘p‘, it will print the specific /dev/sda partition table.

  • How to Format a Partition in Linux
mkfs.ext4 /dev/sda4
  • How to Check Size of a Partition in Linux
fdisk -s /dev/sda2

https://www.tecmint.com/fdisk-commands-to-manage-linux-disk-partitions/