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 21
  • 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
  • Feature Request: Ability to not cross filesystem boundaries.

    Feature Request: Ability to not cross filesystem boundaries.

    Hi,

    Currently (v0.11.0) when you have mounted (remote) filesystems, diskonaut is also accounting them in its scan.

    I would love to see a flag like -xdev in the (GNU) find command or -x in the ncdu command which tells diskonaut to ignore all directories that are other filesystem mounts.

    Thanks in advance for your consideration.

    opened by ForeverNooob 0
  • 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 9 Jul 26, 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.3k Sep 16, 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 9k Sep 17, 2022
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.5k Sep 22, 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.6k Sep 22, 2022
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 685 Sep 25, 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
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.5k Sep 19, 2022
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 117 Sep 16, 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 21 Sep 20, 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 10 Aug 26, 2022
A tiling window manager for Windows 10 based on binary space partitioning

yatta BSP Tiling Window Manager for Windows 10 Getting Started This project is still heavily under development and there are no prebuilt binaries avai

Jade 139 Jul 21, 2022
Fast Hilbert space-filling curve transformation using a LUT

Fast Hilbert Fast Hilbert 2D curve computation using an efficient Lookup Table (LUT). Convert from discrete 2D space to 1D hilbert space and reverse V

Armin Becher 15 Aug 30, 2022
A space-themed shoot 'em up game.

Zenith A space-themed shoot 'em up game made with Bevy. Building from source After you clone this repository, ensure you have Rust installed. Dependin

Amelia Clarke 20 Aug 12, 2022