anthraxx / dfrs Goto Github PK
View Code? Open in Web Editor NEWDisplay file system space usage using graphs and colors
License: MIT License
Display file system space usage using graphs and colors
License: MIT License
This is great; good work :)
Just a suggestion / request, but... a du -hcs *
equivalent, durs
, would be really nice. Essentially for something like kdirstat, but at the command line.
If enough of the code was shared, it might make sense to have the same executable behave differently based on its argv[0]
name (durs
or dfrs
), as some other tools (whatis
, mtools
, gawk
, etc.) do.
Edit: never mind. inspired by this, I found a few du equivalents on crates.io, like parallel-disk-usage
:)
i
[yuri@yv /usr/ports/sysutils/dfrs]$ dfrs
Error: No such file or directory (os error 2)
It doesn't say what file it was trying to open.
It was actually /proc/self/mounts
.
15940 dfrs NAMI "/proc/self/mounts"
15940 dfrs RET openat -1 errno 2 No such file or directory
sysctl kern.disks
reads mounted disks on FreeBSD.
dfrs is kinda bad-color-noisy with default tresholds:
so is duf, for example:
but duf has a flag to modify them:
How duf
does it is however still not perfect, my complex suggestion to tackle this properly is here: Canop/dysk#18 (comment)
Can you please add the ability to list mount options (or tell us if you plan to release this feature since the MOUNT structure has the mnt_opts element, which seems to imply that it is planned) as seen in parse_mount() test and like the dfc
tool do :
file : dfrs/src/mount.rs:12
(for the struct β :17) :
#[derive(Clone)]
pub struct Mount {
pub mnt_fsname: String,
pub mnt_dir: String,
pub mnt_type: String,
pub mnt_opts: String,
pub mnt_freq: i32,
pub mnt_passno: i32,
pub capacity: u64,
pub free: u64,
pub used: u64,
pub statfs: Option<nix::sys::statfs::Statfs>,
}
file : dfrs/src/mount.rs:166
(for the test) :
#[test]
fn parse_mounts() {
let file = r#"sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime,hidepid=2 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=2009144k,nr_inodes=502286,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=402800k,mode=755 0 0
/dev/mapper/vg0-root / ext4 rw,relatime,errors=remount-ro 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
pstore /sys/fs/pstore pstore rw,relatime 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=805580k 0 0
/dev/mapper/vg0-boot /boot ext4 rw,relatime 0 0
/dev/mapper/vg0-tmp /tmp ext4 rw,relatime 0 0
none /cgroup2 cgroup2 rw,relatime 0 0
"#;
Thank you for this great tool and to contrib to the rustutils'vers π
df
has --total
. Could be interesting to have this in dfrs
. Together with the better defaults of dfrs
, it would show the net storage with ``
$ df --help | grep total
--total elide all entries insignificant to available space,
and produce a grand total
field names are: 'source', 'fstype', 'itotal', 'iused', 'iavail', 'ipcent',
# df --total -T / /boot /dev
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/nvme0n1p5_crypt btrfs 478497792 158877508 318601596 34% /
/dev/nvme0n1p1 btrfs 487424 188340 240604 44% /boot
udev devtmpfs 16161996 0 16161996 0% /dev
total - 495147212 159065848 335004196 33% -
To keep things simple, maybe --total
should be limited to fs on actual block devices and not tmpfs nor udev?
When using dfrs
, ZFS datasets/filesystems aren't displayed unless dfrs -aa
is used. However, -aa
also displays a lot of filesystems that probably aren't useful to look at, like tmpfs
, hugetlbfs
etc.
Assume a CIFS mount at /mnt/x
, running dfrs /mnt/x
results in
dfrs /mnt/x
Filesystem Type Used% Avail Used Size Mounted on
/xxxxxx/root ext4 ββββββββββββββββββββ 88.8% 52.4G 414.3G 466.7G /
which is equivalent to dfrs /
while df -h
shows usage of the filesystem at //cifshost/folder
.
currently on Ubuntu 22.04 and currently have several snap package installed. When using dfrs (0.0.7), all looped devices for every snap application shows up in the listing which is rather useless since they all show 100% utilization. Was wondering if squashfs filesystems could be added to the list of filesystems that are normally hidden unless -a or -aa is used to show them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.