Space Exploration Disk Analysis

LinuxLinuxBeginner
Practice Now

Introduction

Imagine a team of space scientists exploring a new planet. Dr. Sagan, a key astrobiologist, is responsible for analyzing the planet's disk space. This is crucial for efficiently storing and managing vital research data as the team explores further. Understanding available disk space is essential for the mission's success.

This is a Challenge, which differs from a Guided Lab in that you need to try to complete the challenge task independently, rather than following the steps of a lab to learn. Challenges are usually a bit difficult. If you find it difficult, you can discuss with Labby or check the solution. Historical data shows that this is a beginner level challenge with a 100.00% pass rate.

Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL linux(("Linux")) -.-> linux/SystemInformationandMonitoringGroup(["System Information and Monitoring"]) linux/SystemInformationandMonitoringGroup -.-> linux/df("Disk Space Reporting") subgraph Lab Skills linux/df -.-> lab-271266{{"Space Exploration Disk Analysis"}} end

Disk Space Overview

In this step, you'll learn to use the df command to get a general overview of disk space usage.

Tasks

  • Use the df command to display disk space usage.
  • Identify the file system, size, used space, available space, usage percentage, and mount point for each disk.

Requirements

  • Default working directory: /home/labex/project
  • Use the df command in the terminal.
  • Display all disk space information.
  • Save the output of the command to the file /home/labex/project/df.txt.

Example

Running the command should produce output similar to this:

cd /home/labex/project
cat df.txt
Filesystem     1K-blocks     Used Available Use% Mounted on
overlay         20971520   128756  20842764   1% /
tmpfs              65536        0     65536   0% /dev
tmpfs            3995012        0   3995012   0% /sys/fs/cgroup
shm                65536        0     65536   0% /dev/shm
/dev/vdb       104806400 70116628  34689772  67% /etc/hosts
โœจ Check Solution and Practice

Filtering Disk Space Information

In this step, you'll learn to filter disk space information based on specific file systems or mount points.

Tasks

  • Use the df command with the correct options to display disk space information for a specific file system or mount point.
  • Learn how to filter disk space information for /home/labex.

Requirements

  • Navigate to the home directory of the user labex.
  • Use the df command with filtering options in the terminal.
  • Display disk space information for /home/labex.
  • Save the output of the command to the file /home/labex/project/df2.txt.

Example

After filtering, the output should show disk space information only for the specified file system or mount point.

cd /home/labex/project
cat df2.txt
Filesystem      Size  Used Avail Use% Mounted on
overlay          20G  126M   20G   1% /
โœจ Check Solution and Practice

Summary

In this challenge, you learned how to use the df command in Linux to report disk space usage. This skill is essential for managing disk space effectively in various environments, which helps ensure the smooth operation of data-driven tasks.