Home > System Tutorial > LINUX > How To Get Linux Filesystems Information Using Dysk Utility

How To Get Linux Filesystems Information Using Dysk Utility

Jennifer Aniston
Release: 2025-03-21 10:35:14
Original
882 people have browsed it

Dysk: A Superior Alternative to the df Command for Linux Filesystem Inspection

The df command is a common tool for examining Linux filesystems, showing used and available disk space. However, dysk offers a more detailed and user-friendly experience. This guide explains dysk, its features, installation on Linux, and its usage for retrieving filesystem information.

Table of Contents

  • What is dysk?
  • Installing dysk on Linux
    • Method 1: Using the Cargo Package Manager
    • Method 2: Using Precompiled Binaries
  • Retrieving Linux Filesystem Information with dysk
  • Frequently Asked Questions
  • Conclusion

Introduction

A Linux filesystem organizes and manages files on a disk or partition. Understanding its structure is crucial for efficient system administration. While df is widely used, dysk provides a superior alternative.

What is dysk?

dysk (formerly 'lfs') is a command-line tool displaying detailed mounted disk information in Linux. It's considered an improvement over df -H. Key advantages include:

  • Disk identification ("rem," "HDD," "SSD").
  • Consistent use of SI units.
  • Filesystem type display.
  • Size-based filesystem sorting.
  • Tabular output (unlike df's list format).

dysk is open-source and written in Rust.

Installing dysk on Linux

Installation is possible via Cargo or precompiled binaries.

Method 1: Using the Cargo Package Manager

Install Rust: If Rust isn't installed, install it first. (Instructions for installing Rust on Linux are readily available online).

Update Rust (if installed):

$ rustup update
Copy after login

Install dysk:

$ cargo install --locked dysk
Copy after login

Method 2: Using Precompiled Binaries

Download the Binary: Download the latest release from the dysk releases page. Replace x86_64-linux with your architecture if necessary.

$ wget https://dystroy.org/dysk/download/x86_64-linux/dysk
Copy after login

Add to $PATH: Move the executable to a directory in your $PATH (e.g., /usr/local/bin/).

$ sudo mv dysk /usr/local/bin/
Copy after login

Retrieving Linux Filesystem Information with dysk

Here are examples of using dysk:

Basic Overview:

$ dysk
Copy after login

This lists mounted disks, showing size, used space, free space, and usage percentage.

<code>┌──────────┬────┬────┬────┬─────────┬────┬────┬───────────┐
│filesystem│type│disk│used│   use   │free│size│mount point│
├──────────┼────┼────┼────┼─────────┼────┼────┼───────────┤
│/dev/sda6 │ext4│HDD │3.2G│10% ▌    │ 30G│ 34G│/home      │
│/dev/sda1 │ext4│HDD │7.1G│40% ██   │ 11G│ 18G│/          │
└──────────┴────┴────┴────┴─────────┴────┴────┴───────────┘</code>
Copy after login

How To Get Linux Filesystems Information Using Dysk Utility

Listing All Filesystems: Use the -a option:

$ dysk -a
Copy after login

How To Get Linux Filesystems Information Using Dysk Utility

Inode Information: Use -c inodes:

$ dysk -c  inodes
Copy after login

How To Get Linux Filesystems Information Using Dysk Utility

Custom Columns: Use -c to customize column order and selection. Refer to the dysk documentation for available columns.

How To Get Linux Filesystems Information Using Dysk Utility

Current Directory's Disk:

$ dysk .
Copy after login

How To Get Linux Filesystems Information Using Dysk Utility

Filtering: Use -f for filtering based on usage, free space, type, etc. (Examples provided in the original text).

How To Get Linux Filesystems Information Using Dysk Utility

Sorting: Use -s to sort by columns (e.g., -s free). Add -desc for descending order.

How To Get Linux Filesystems Information Using Dysk Utility

JSON Output: Use -j for JSON output.

Frequently Asked Questions (FAQs) and Conclusion are similar to the original text, but phrasing can be adjusted for improved flow and clarity. Remember to replace placeholder image URLs with actual URLs.

The above is the detailed content of How To Get Linux Filesystems Information Using Dysk Utility. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template