df Command in Linux

Learn via video courses
Topics Covered

Build an AI-First Career, Master the Complete Skillset

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program
NSDC Certified

AI Forward Deployed Engineer Program

Full-stack engineering, production AI and client-facing consulting

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program

Overview

The df command in Linux is used to display the disk space usage of file systems. It provides a snapshot of the total space, used space, available space, and the percentage of space used on each mounted file system.

Linux df Command Syntax

The syntax for the df command is as follows:

Where:

  • OPTIONS: The options or flags used to modify the behavior of the df command.
  • FILE: The file or file system for which the disk usage information is required. If not provided, df will display information for all mounted file systems.

df Command Options:

  • -a, --all: Include dummy file systems and display information for all file systems.
  • -h, --human-readable: Display sizes in a human-readable format (e.g., 1K, 234M, 2G).
  • -T, --print-type: Display the file system type.
  • -i, --inodes: Display inode information instead of block usage.
Sharpen Your Fundamentals with Free Learning

Example Usages

  • Display disk usage for all mounted file systems.:

    Output:

    Explanation: This command displays the disk usage of all mounted file systems with their respective sizes in 1K blocks.

  • Display disk usage for all file systems in human-readable format.:

    Output:

    Explanation: This command displays the disk usage of all mounted file systems with their respective sizes in a human-readable format.

How Scaler Transformed Careers in Different Fields

₹23L
AVG CTC
SCALER PLACEMENT PROOF

Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.

11,000+placements
650+companies
Verified data
Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more

Tips

  • Use the -h or --human-readable option to make the output easier to understand.

  • Combine the -T and -h options to display both the file system type and sizes in a human-readable format.

Advanced Use Cases of df Command in Linux

  • Display disk usage for a specific file or directory.:

    Output:

    Explanation: This command displays the disk usage of the file system containing the specified file or directory.

  • Display inode information for all file systems.:

    Output:

    Explanation: This command displays the inode information of all mounted file systems.

  • Display disk usage with file system type for all mounted file systems.:

    Output:

    Explanation: This command displays the disk usage of all mounted file systems along with their file system type and sizes in a human-readable format.

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

Conclusion

  • The df command is used to display the disk space usage of file systems.

  • It provides information about total space, used space, available space, and the percentage of space used.

  • Use the -h option to display sizes in a human-readable format.

  • The -T option displays the file system type.

  • The -i option displays inode information instead of block usage.