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
dysk
?dysk
on Linuxdysk
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.
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:
df
's list format).dysk
is open-source and written in Rust.
dysk
on LinuxInstallation is possible via Cargo or precompiled binaries.
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
Install dysk
:
$ cargo install --locked dysk
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
Add to $PATH
: Move the executable to a directory in your $PATH
(e.g., /usr/local/bin/
).
$ sudo mv dysk /usr/local/bin/
dysk
Here are examples of using dysk
:
Basic Overview:
$ dysk
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>
Listing All Filesystems: Use the -a
option:
$ dysk -a
Inode Information: Use -c inodes
:
$ dysk -c inodes
Custom Columns: Use -c
to customize column order and selection. Refer to the dysk
documentation for available columns.
Current Directory's Disk:
$ dysk .
Filtering: Use -f
for filtering based on usage, free space, type, etc. (Examples provided in the original text).
Sorting: Use -s
to sort by columns (e.g., -s free
). Add -desc
for descending order.
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!