Terminal disk space navigator 🔭

Overview

diskonaut

demo

How does it work?

Given a path on your hard-drive (which could also be the root path, eg. /). diskonaut scans it and indexes its metadata to memory so that you could explore its contents (even while still scanning!).

Once completed, you can navigate through subfolders, getting a visual treemap representation of what's taking up your disk space. You can even delete files or folders and diskonaut will track how much space you've freed up in this session.

Installation

Download a prebuilt binary

If you're using linux, you can check out the "releases" of this repository to download the latest prebuilt binary.

With cargo (linux / macOS / windows)

cargo install diskonaut

Fedora/CentOS

sudo dnf install diskonaut

For older Fedora releases and CentOS available in COPR:

sudo dnf copr enable atim/diskonaut -y
sudo dnf install diskonaut

Arch Linux

Available in the AUR:

yay diskonaut

Gentoo

Available through the following overlay as sys-fs/diskonaut:

https://github.com/telans/EBUILDS

Nix / NixOS

Available in nixpkgs:

$ nix-env --install diskonaut
$ # (Or using the attribute name, which is also diskonaut.)

FreeBSD

Available in freshports:

pkg install diskonaut

macOS

Available in Homebrew

brew install diskonaut

Also available in nixpkgs: see Nix section for more details.

Supported platforms

Right now diskonaut supports linux, macos and windows.

Usage

Either start diskonaut in the folder you want to scan, or provide it with the folder you'd like to scan as an argument:

$ diskonaut /home/aram

Contributing

Contributions of any kind are very much welcome. If you think diskonaut is cool and you'd like to hack at it, feel free to look through the issues. Take a look especially at ones marked "help wanted" or "good first issue". Also, if you found a bug or have an idea for a new feature, please feel free to open an issue to discuss it.

For more detailed information, please see the CONTRIBUTING.md file at the root of this repository.

If at any point you feel stuck, are unsure how to begin or what to work on, please do not hesitate to reach out to me personally: [email protected]

License

MIT

Comments
  • windows version

    windows version

    100% conversion to crossterm (no dual mode)

    seems to work fine, test on windows 10 using new windows terminal and powershell works on my rasp pi system too

    tests all compile but dont run

    opened by pm100 22
  • Tests fail because diskonaut reports incorrect file sizes on filesystems with compression

    Tests fail because diskonaut reports incorrect file sizes on filesystems with compression

    On my machine and several CI builders, diskonaut tests fail. The problem is that the rust-filesize uses MetadataExt::blocks to get the number of file blocks:

    https://github.com/Freaky/rust-filesize/blob/e8042c00cebd215ac9f106e8b5a20b0c072fd77d/src/lib.rs#L72

    However, this method is not reliable. For example:

    $ cat blksize.rs 
    use std::fs;
    use std::os::unix::fs::MetadataExt;
    use std::io;
    
    fn main() -> io::Result<()> {
        let meta = fs::metadata("2pow20bytes")?;
        let blocks = meta.blocks();
        let block_size = meta.blksize();
        eprintln!("blocks: {}, block size: {}", blocks, block_size);
        Ok(())
    }
    $ rustc blksize.rs
    $ dd if=/dev/zero of=2pow20bytes bs=1024 count=1024
    $ ls -l 2pow20bytes 
    -rw-r--r-- 1 daniel users 1048576 Jun 25 19:48 2pow20bytes
    $ ./blksize 
    blocks: 1, block size: 131072
    

    So, this will be reported as a 512 byte file(!), even though it is 1MiB. The wonders of (ZFS) filesystem compression.

    $ dd if=/dev/urandom of=2pow20bytes bs=1024 count=1024
    $ ./blksize 
    blocks: 2065, block size: 131072
    
    bug 
    opened by danieldk 13
  • thread 'main' panicked at 'index out of bounds: the len is 3600 but the index is 3600

    thread 'main' panicked at 'index out of bounds: the len is 3600 but the index is 3600

    /mnt/n/AppData/Local/Bisq/runtime/include/win32/bridge                                      thread 'main' panicked at 'index out of bounds: the len is 3600 but the index is 3600', /rustc/4fb7144ed159f94491249e86d5bbd033b5d60550/src/libcore/slice/mod.rs:2842:10
    

    asciicast

    Running in WSL 2 with rustc 1.43.0 (4fb7144ed 2020-04-20).

    bug discussion 
    opened by jonahsnider 12
  • Emacs keybindings

    Emacs keybindings

    Fixes #36 ... again I've added a key! macro to make it easier to define patterns like Event::Key(Key::Char(..))

    In my first PR I think I replaced one of the other keybindings with \n when it was supposed to be n, so this should fix that, since the tests are working locally. Although for some reason if I run the same tests multiple times without changing the code I get different results.

    opened by redzic 12
  • Resolving #16 - Feature: add an

    Resolving #16 - Feature: add an "Are you sure you want to quit?" modal

    this commit will add an ability to the app which asks user for confirmation just before exit, both in normal and loading mode. please feel free to comment or ask for any changes.

    squashed commits:

    • add keyEvent handler function for exiting mode
    • add Exiting variant to UiMode enum | add prompt_exit method
    • implement ExitingMode widget render functionality
    • fix mixed UiState issue
    opened by mhdmhsni 11
  • Platform: windows port

    Platform: windows port

    There are two main things I know of that we need to do to port diskonaut to work on windows:

    1. Currently we rely on hard disk blocks to scan the hard-drive. As far as I know, this does not work on windows, and so we need to find another solution.
    2. Termion doesn't(?) work on windows, so we would need to use another backend for TUI.

    I am VERY interested in a solution for this. If you want to work on this and are unsure how to begin, or the points above are not clear, I would be very happy to discuss this with you further and clarify anything. Please do not hesitate. :)

    help wanted 
    opened by imsnif 10
  • Performance

    Performance

    Scanning large volumes with diskonaut takes some time. Not terrible (likely less than 10 minutes for really populated volumes) but this is still not the best experience.

    It could be nice to experiment with scanning parallelization, as long as it does not impact performance. I feel a slow scan is better than a fast scan that makes your computer stuck and unable to do anything else.

    opened by imsnif 9
  • Make enter select largest folder if nothing is selected

    Make enter select largest folder if nothing is selected

    Fixes #37 Although, the way it is now, it will only select (but not cd into) the largest folder if nothing is selected. From the wording "... the app goes into the largest folder" in the comment of #37 I wasn't really sure if it should cd into the largest folder or just select it. However, if should also cd into it, it should be a very trivial change in the handle_enter function.

    opened by redzic 8
  • Feature: add an

    Feature: add an "Are you sure you want to quit?" modal

    Right now, when we press "Ctrl-C" or "q" to exit, the app exits immediately. It would be nice if we could add a modal that prompts the user in case they pressed this by mistake.

    good first issue 
    opened by imsnif 8
  • Feature: Support for Filesystem Compression (e.g. NTFS, BTRFS, ...)

    Feature: Support for Filesystem Compression (e.g. NTFS, BTRFS, ...)

    When running diskonaut on a BTRFS filesystem with compression enabled, it shows the uncompressed space used by folders and files, not the actual disk-space used.

    One folder of mine using 69.5G of storage, but if I delete this folder I would not regain 69.5G worth of disk space because that folder is being compressed instead I would only regain 50G of space which represents the actual space used on the disk.

    The command [sudo compsize /path/to/folder] was able to identify the post-compression space used.

    Rationale for feature:

    If I am using this tool, I am likely trying to free space so that I may allocate a new file.

    Suppose I want to download a 4GiB iso image. If I have a 4.5GiB zip archive and a 5GiB text-file, diskonaut would make it appear that deleting the text-file would let me download the iso with a GiB to spare. Unfortunately, with compression enabled, the compressible zip archive would still free up 4.5GiB while the highly compressible text-file may only free a 900MiB. At that point I would download the iso, run out of space and then have to reopen diskonaut to free ? more GiB (and hope that compression doesn't cause more trouble).

    Design Questions

    • How should the compressed vs uncompressed space be represented in the UI?

      The uncompressed usage may still be useful if I plan on copying my files to a location without compression.

    • On filesystems where it is relatively slow to compute the compressed disk usage, should there be a fast estimation run where placeholders (e.g. 69.5G??? would be displayed above) until the slower more accurate run occurs.

      • How should the estimation be displayed? I chose 69.5G??? earlier but maybe <69.5G> or some other formatting makes more sense.
    • What configuration flags should be added?

      • Formatting
      • Enabling/Disabling feature
      • Enabling/Disabling faster estimation process.

    Relevant Filesystems

    This Wikipedia table of filesystem capabilities shows that the following support compression.

    • BeeGFS
    • APFS
    • NTFS
    • F2FS
    • Reiser4
    • NSS
    • NWFS
    • Fossil
    • ZFS
    • BTRFS
    • SquashFS
    bug discussion 
    opened by dbramucci 7
  • Resolving #32: implement a warning modal on deleting a file/folder while s…

    Resolving #32: implement a warning modal on deleting a file/folder while s…

    Hi @imsnif, this commit resolves https://github.com/imsnif/diskonaut/issues/32.

    • added WarningBox to modals module.
    • rendering logic is similar to other modals. nothing specific to mention.
    • about the auto close functionality i added a WarningTimeout variant to your Event enum. this event waits for 5 seconds then resets the ui state using Instruction::ResetUiMode.

    please let me know if anything needs to change.

    opened by mhdmhsni 6
  • Graphics break down when running over SSH to Windows

    Graphics break down when running over SSH to Windows

    When I ssh to a remote and I ran the utility, the graphics break down, although the functionality seem to work.

    My machine is Windows, the remote is Windows. If the remote is Linux, no problem.

    opened by thisismygitrepo 1
  • aarch64 and armhf doest pass tests ?

    aarch64 and armhf doest pass tests ?

    Hey there,

    I'm packaging diskonaut for Alpine Linux but it seems tests fails for those two architectures.

    https://gitlab.alpinelinux.org/StacyHarper/aports/-/pipelines/114814

    Is it known ?

    edit: and it seems that armv7 can also fail o_O https://gitlab.alpinelinux.org/StacyHarper/aports/-/pipelines/114819

    opened by stacyharper 0
  • offer prebuild deb files in a ppa

    offer prebuild deb files in a ppa

    It would be useful to have prebuild deb packages in a ppa at https://launchpad.net . So people can install it with getting updates and without having to compile it themself.

    opened by freddii 0
Releases(0.11.0)
Owner
Aram Drevekenin
Aram Drevekenin
Checks if there are enough space in a specified path.

@planetarium/check-free-space This package uses native OS APIs to get free size available on specified path. It is powered by fs2 under the hood. APIs

Planetarium 8 Dec 5, 2022
Terminal bandwidth utilization tool

bandwhich This is a CLI utility for displaying current network utilization by process, connection and remote IP/hostname How does it work? bandwhich s

Aram Drevekenin 7.5k Dec 31, 2022
Blazing 💥 fast terminal-ui for git written in rust 🦀

Blazing fast terminal client for git written in Rust Features Fast and intuitive keyboard only control Context based help (no need to memorize tons of

Stephan Dilly 11.8k Jan 5, 2023
Terminal disk space navigator 🔭

Given a path on your hard-drive (which could also be the root path, eg. /). diskonaut scans it and indexes its metadata to memory so that you could explore its contents (even while still scanning!).

Aram Drevekenin 1.6k Dec 30, 2022
dua (-> Disk Usage Analyzer) is a tool to conveniently learn about the usage of disk space of a given directory

dua (-> Disk Usage Analyzer) is a tool to conveniently learn about the usage of disk space of a given directory. It's parallel by default and will max

Sebastian Thiel 1.8k Jan 2, 2023
Save disk space by cleaning non-essential files from software projects.

Kondo ?? Cleans unneeded directories and files from your system. It will identify the disk space savings you would get from deleting temporary/unneces

Trent 920 Dec 27, 2022
osu-link is a program which links osu!stable beatmaps to osu!lazer's new store format, saving you disk space.

osu-link is a program which links osu!stable beatmaps to osu!lazer's new store format, saving you disk space.

LavaDesu 2 Nov 8, 2021
A simple space shooter game. Runs in the terminal using characters-based UI. Fully written in Rust, using the "ruscii" library.

Thrust - a terminal shooter game Originally created as a project for the "Missing Semester" course at JKU Linz (338.006). The game is entirely written

Mathias Wöß 3 Jan 16, 2023
CoreOS Disk Image Rehydrator

In CoreOS we ship a lot of disk images, one for each platform. These are almost entirely the same thing, mostly just with an ignition.platform.id stamp in each disk image, wrapped in a hypervisor/platform specific container.

Colin Walters 6 Jan 19, 2022
Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Benjamin Vaisvil 1.6k Jan 4, 2023
disk backed wal queue

Repository Template  Queue like disk backed WAL Pronouced Quál - from the german wordrd for agony - because it is. Operations The basic concept is si

The Tremor Project 8 Jun 4, 2022
A tool to subscribe to Twitch channels and store them efficiently on disk

twitch-messages A tool to subscribe to Twitch channels and store them efficiently on disk Build the Tools You can start by building the binaries that

Clément Renault 1 Oct 31, 2021
Count zeroes on a disk or a file

Count zeroes on a disk or a file

Cecile Tonglet 1 Dec 12, 2021
"putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely.

Putzen "putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely. About In short, putzen solves

Sven Assmann 2 Jul 4, 2022
A library for loading and executing PE (Portable Executable) from memory without ever touching the disk

memexec A library for loading and executing PE (Portable Executable) from memory without ever touching the disk This is my own version for specific pr

FssAy 5 Aug 27, 2022
garbage-collecting on-disk object store, supporting higher level KV stores and databases.

marble Garbage-collecting disk-based object-store. See examples/kv.rs for a minimal key-value store built on top of this. Supports 4 methods: read: de

Komora 215 Dec 30, 2022
Rust libraries for working with GPT (GUID Partition Table) disk data

gpt-disk-rs no_std libraries related to GPT (GUID Partition Table) disk data. There are three Rust packages in this repository: uguid The uguid packag

Google 25 Dec 24, 2022
bin2json extract recursively file, directory of files (or disk dump) metadata to json

bin2json bin2json extract metadata from different binary file format to json. It can take in input a file, a directory containing different files, a d

null 11 Oct 6, 2022
Executables on Disk? Bleh 🤮

Executables on Disk? Preposterous! Saving executables to disk is like telling EDRs that "Hey! Take a look at this thing I just fetched from the Intern

whokilleddb 87 Dec 18, 2022
A user-friendly, lightweight TUI for disk imaging

Caligula Burning Tool Caligula is a user-friendly, lightweight TUI for imaging disks. $ caligula burn -h Burn an image to a disk Usage: caligula burn

Astrid Yu 25 Mar 26, 2023