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

Issues
  • 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
  • New feature: delete key to delete

    New feature: delete key to delete

    Currently one presse Control-D to delete an entry. My first thought was to press the Delete key! I suggest making Delete also work to delete

    discussion 
    opened by rory 16
  • 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
  • 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
  • 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
  • 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
  • Chore: bump deps

    Chore: bump deps

    tui to 0.8 insta to 0.16.0 cargo-insta to 0.16.0

    This related to packaging diskonaut for official Linux repos.

    opened by tim77 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
  • chore: Update jwalk to 0.6

    chore: Update jwalk to 0.6

    Fixes: https://github.com/imsnif/diskonaut/issues/82 Signed-off-by: Igor Raits [email protected]

    opened by ignatenkobrain 0
  • Update jwalk dependency to 0.6

    Update jwalk dependency to 0.6

    Would help a lot in packaging diskonaut, thanks!

    opened by ignatenkobrain 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
  • Feature Request: Give an option to exclude directory

    Feature Request: Give an option to exclude directory

    • Sometimes I don't want to index the external HDDs I have connected
    • Sometimes I want to index some files which match some pattern
    opened by avinassh 0
  • De-duplicate navigation code

    De-duplicate navigation code

    • Factor out movement into own function
    • Introduce horizontal/vertical switch to avoid x/y duplicated code
    opened by phimuemue 0
  • Added production-ready Dockerfile

    Added production-ready Dockerfile

    Hey, We added production-ready Dockerfile to ur project. U can add CI/CD to that to automate pushing to Docker Hub. If u want to test how it works u have to build image.

    docker build . -t diskonaut
    

    After that u can use it as normally installed app.

    docker run -t -v absolute_path:container_path diskonaut container_path
    

    Co-Authored-By: kaurelia [email protected]

    opened by KrzysztofZawisla 0
  • Add GitHub Actions (GHA) CICD workflow

    Add GitHub Actions (GHA) CICD workflow

    The PR adds a complete GHA CICD workflow:

    • includes multiple linux, macos, and windows platform builds and testing
    • includes automated packaging and publishing/deployment to GitHub Releases when commit is version tagged
    • includes Style testing (both cargo fmt and cargo clippy warnings); note: warnings add notations but don't break the workflow build
      • there are about 9 distinct cargo clippy warnings generated for the current project code
    • includes test for minimum rust supported version (aka, MinSRV, MSRV, MinRustV); easily removed if not desired
    • includes automatic CodeCov coverage reporting (if/when testing is included); also, easily removed if not desired
      • NOTE: several of the usual code coverage compiler flags cause test errors for this project so coverage here is using only -Zprofile, and coverage looks to be skewed (see notes below); I don't have the project knowledge to fix the test failures.

    I've been doing some initial experimentation with your project, and I wanted to contribute some automation that might be helpful to you going forward. This contributed workflow is a slightly modified form based on other GHA CICD workflows that I've designed (and are in current use) for uutils/coreutils, bootandy/dust, Peltoche/lsd, sharkdp/bat, sharkdp/pastel.

    I'm happy to make any changes that you would find useful as improvements.

    Code coverage notes

    For code coverage, the usual flag setting is RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort', but that combination causes compilation failure with:

    error[E0463]: can't find crate for `proc_macro_error_attr`
       --> C:\Users\Roy\.cargo\registry\src\github.com-1285ae84e5963aae\proc-macro-error-1.0.2\src\lib.rs:266:9
        |
    266 | pub use proc_macro_error_attr::proc_macro_error;
        |         ^^^^^^^^^^^^^^^^^^^^^ can't find crate
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0463`.
    error: could not compile `proc-macro-error`
    
    To learn more, run the command again with --verbose.
    warning: build failed, waiting for other jobs to finish...
    error[E0463]: can't find crate for `failure_derive`
      --> C:\Users\Roy\.cargo\registry\src\github.com-1285ae84e5963aae\failure-0.1.8\src\lib.rs:56:1
       |
    56 | extern crate failure_derive;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0463`.
    error: build failed
    

    Using RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off', tests compile but only one test passes:

    ...
    
    ---- tests::cases::ui::zoom_into_small_files stdout ----
    ---- tests::cases::ui::zoom_into_small_files stderr ----
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "tests run with disabled concurrency, automatic snapshot name generation is not supported.  Consider using the \"backtrace\" feature of insta which tries to recover test names from the call stack."', C:\Users\Roy\.cargo\registry\src\github.com-1285ae84e5963aae\insta-0.16.0\src\runtime.rs:863:22
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    failures:
        tests::cases::ui::cannot_move_into_small_files
        tests::cases::ui::cant_delete_file_with_term_too_small
        tests::cases::ui::clear_selection_when_moving_off_screen_edges
        tests::cases::ui::delete_file
        tests::cases::ui::delete_file_no_confirmation
        tests::cases::ui::delete_file_press_n
        tests::cases::ui::delete_folder
        tests::cases::ui::delete_folder_no_confirmation
        tests::cases::ui::delete_folder_small_window
        tests::cases::ui::delete_folder_small_window_no_confirmation
        tests::cases::ui::delete_folder_with_multiple_children
        tests::cases::ui::delete_folder_with_multiple_children_no_confirmation
        tests::cases::ui::eleven_files
        tests::cases::ui::empty_folder
        tests::cases::ui::enter_folder
        tests::cases::ui::enter_folder_medium_width
        tests::cases::ui::enter_folder_small_width
        tests::cases::ui::enter_largest_folder_with_no_selected_tile
        tests::cases::ui::esc_to_go_up
        tests::cases::ui::files_with_size_zero
        tests::cases::ui::medium_width
        tests::cases::ui::minimum_tile_sides
        tests::cases::ui::move_down_and_enter_folder
        tests::cases::ui::move_left_and_enter_folder
        tests::cases::ui::move_right_and_enter_folder
        tests::cases::ui::move_up_and_enter_folder
        tests::cases::ui::noop_when_entering_file
        tests::cases::ui::noop_when_pressing_esc_at_base_folder
        tests::cases::ui::pressing_delete_with_no_selected_tile
        tests::cases::ui::small_files
        tests::cases::ui::small_files_with_x_as_zero
        tests::cases::ui::small_files_with_y_as_zero
        tests::cases::ui::small_width
        tests::cases::ui::small_width_long_folder_name
        tests::cases::ui::too_small_height
        tests::cases::ui::too_small_width_five
        tests::cases::ui::too_small_width_four
        tests::cases::ui::too_small_width_one
        tests::cases::ui::too_small_width_three
        tests::cases::ui::too_small_width_two
        tests::cases::ui::two_large_files_one_small_file
        tests::cases::ui::zoom_into_small_files
    
    test result: FAILED. 1 passed; 42 failed; 0 ignored; 0 measured; 0 filtered out
    

    Using RUSTFLAGS: '-Zprofile -Clink-dead-code -Coverflow-checks=off', tests compile but two test failures occur:

    failures:
    tests::cases::ui::delete_file_no_confirmation
    tests::cases::ui::delete_folder_no_confirmation
    
    test result: FAILED. 41 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out
    
    opened by rivy 3
  • Bug: Runaway memory usage when run on large directories

    Bug: Runaway memory usage when run on large directories

    Hey @imsnif ! Another awesome application! Hopefully I can help out with some of those easier issues you've added to the list sometime soon!

    I've run into a bit of an issue in running diskonaut on my server through: after around an hour of indexing files, diskonaut was using 22GB of RAM! This pushed a bunch of system processes to swap and brought down a couple of services I had running.

    I'll have to take a peek at the code, but I'm assuming this is from tracking the name and information of every file encountered during a scan. If that's the case, then perhaps diskonaut could intelligently decided when RAM usage is getting a bit out of control and collapse sub-trees into a single total size. That would mean that, if you wanted to dive into that sub-tree, you might need to re-index it, but it's just an idea. Having the current directory fully indexed would be good to keep zooming in and out quickly, but I think it's acceptable to re-index sub-directories when you enter them.

    As I understand, some other disk-usage applications (like baobab from GNOME) don't even bother tracking individual files. I think it's good that diskonaut does allow you to view those (I'm absolutely in love with the zoom feature!!), but maybe it shouldn't store information for every file all of the time.

    Thanks again for the awesome app!

    bug discussion 
    opened by TheLostLambda 8
  • Bug: Small files hidden from view

    Bug: Small files hidden from view

    Here is the display using ncdu:

    --- /path/to/projects/shader_brot ------------------------------------------------------------------------
                             /..
        1.1 GiB [##########] /target                                                                          
      216.0 KiB [          ] /.git
      116.0 KiB [          ]  Cargo.lock
       20.0 KiB [          ]  LICENSE
       20.0 KiB [          ] /resources
       20.0 KiB [          ] /src
        4.0 KiB [          ]  README.md
        4.0 KiB [          ]  TODO.md
        4.0 KiB [          ]  Cargo.toml
        4.0 KiB [          ]  .gitattributes
        4.0 KiB [          ]  .gitignore
    
                           β”Œβ”€β”€β”€Item info──────────────────────────────────────────────┐
                           β”‚                                                          β”‚
                           β”‚  Name: target                                            β”‚
                           β”‚  Path: /path/to/projects/shader_brot                     β”‚
                           β”‚  Type: Directory                                         β”‚
                           β”‚                                                          β”‚
                           β”‚     Disk usage:   1.1 GiB (1,180,995,584 B)              β”‚
                           β”‚  Apparent size:   1.1 GiB (1,174,963,573 B)              β”‚
                           β”‚                                                          β”‚
                           β”‚                              Press i to hide this window β”‚
                           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    

    here is the display in diskonaut:

     Total: 1.4G (2797 files), freed: 0 | /path/to/projects/shader_brot
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚                                                                                                        β”‚
    β”‚                                                                                                        β”‚
    β”‚                                                                                                        β”‚
    β”‚                                                                                                        β”‚
    β”‚                                      target/ (+2740 descendants)                                       β”‚
    β”‚                                                                                                        β”‚
    β”‚                                              1.4G (100%)                                               β”‚
    β”‚                                                                                                        β”‚
    β”‚                                                                                                        β”‚
    β”‚                                                                                                        β”‚
    β”‚                                                                                                        β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                                                            (x = Small files)
    

    I ran the numbers:

    • small files take up 425984B
    • target takes up 0.999639430994373 of the directory (FP errors in that)

    Only going by behavior shown, I suspect the % of the directory that target/ takes up is being rounded to a flat 100%, causing the render to exclude the other files.

    bug 
    opened by Ben-PH 7
Releases(0.11.0)
Owner
Aram Drevekenin
Aram Drevekenin
Read-only mirror of https://gitlab.gnome.org/GNOME/gparted

GPARTED ======= Gparted is the GNOME Partition Editor for creating, reorganizing, and deleting disk partitions. A hard disk is usually subdivided int

GNOME Github Mirror 169 Jun 6, 2021
Make any web page a desktop application

Nativefier You want to make a native wrapper for WhatsApp Web (or any web page). nativefier 'web.whatsapp.com' You're done. Introduction Nativefier is

null 27.2k Jun 4, 2021
Create multiboot live Linux on a USB disk...

Only limited instructions are provided here. For detailed instruction please refer User guide What is multibootusb? MultiBootUSB is a cross platform*

multibootusb 1.1k Jun 4, 2021
Mobile Shell

Mosh: the mobile shell Mosh is a remote terminal application that supports intermittent connectivity, allows roaming, and provides speculative local e

Mosh (mobile shell) 10k Jun 4, 2021
βš“οΈ Anchr provides you with a toolbox for tiny tasks on the internet, especially bookmark collections

Anchr - Image uploads, bookmarks and shortlink service Anchr is a useful little helper or toolbox or the like for common tasks on the internet. It com

Ferdinand MΓΌtsch 73 Jun 2, 2021
BleachBit system cleaner for Windows and Linux

BleachBit BleachBit cleans files to free disk space and to maintain privacy. Running from source To run BleachBit without installation, unpack the tar

null 1.2k Jun 5, 2021
Type emoji easily! Virtual keyboard-like emoji palette for Linux with lots of features.

Emoji keyboard Virtual keyboard-like emoji palette for Linux. If you find this software useful, please Emoji support on Linux is shaky at best. Modern

Tomas Ravinskas 236 Jun 2, 2021
TMSU lets you tags your files and then access them through a nifty virtual filesystem from any other application.

Overview TMSU is a tool for tagging your files. It provides a simple command-line utility for applying tags and a virtual filesystem to give you a tag

Paul Ruane 1.5k Jun 1, 2021
Online genealogy

webtrees - online collaborative genealogy Contents License Coding styles and standards Introduction System requirements Internet browser compatibility

Greg Roach 550 Jun 7, 2021
Dude, where are my bytes: Duc, a library and suite of tools for inspecting disk usage

Duc is a collection of tools for indexing, inspecting and visualizing disk usage. Duc maintains a database of accumulated sizes of directories of the

Ico Doornekamp 419 Jun 3, 2021
Send browser notifications from your terminal. No installation. No registration.

Notica Send browser notifications from your terminal. No installation. No registration. https://notica.us/ Usage Notica is a Bash function / alias tha

Tanner Collin 232 Jun 6, 2021
A simple webfont hosting. Google Fonts alternative for your own fonts.

Web fonts repository A simple webfont hosting inspired by Google Fonts. It runs on your server, stores and distributes webfont files and generates CSS

Surgie Finesse 62 May 14, 2021