Convert Figma logo to code with AI

imsnif logodiskonaut

Terminal disk space navigator 🔭

2,344
62
2,344
37

Top Related Projects

3,790

Fast disk usage analyzer with console interface written in Go

12,655

Disk Usage/Free Utility - a better 'df' alternative

8,538

A more intuitive version of du in rust

3,931

View disk space usage and delete unwanted data, fast.

2,155

A TUI system monitor written in Rust

Quick Overview

Diskonaut is a terminal-based disk space visualization tool. It allows users to explore their file system interactively, providing a visual representation of file and directory sizes. Diskonaut helps users identify large files and directories that consume significant disk space.

Pros

  • Interactive and visually appealing interface for exploring disk usage
  • Efficient navigation through large file systems
  • Ability to delete files and directories directly from the interface
  • Cross-platform support (Linux, macOS, Windows)

Cons

  • Requires Rust programming environment for installation from source
  • Limited customization options for visualization
  • May have performance issues with extremely large file systems
  • Learning curve for users unfamiliar with terminal-based interfaces

Getting Started

To install Diskonaut, you can use one of the following methods:

  1. Using Cargo (Rust package manager):
cargo install diskonaut
  1. On macOS using Homebrew:
brew install diskonaut
  1. On Arch Linux using pacman:
pacman -S diskonaut

To run Diskonaut, open a terminal and navigate to the directory you want to analyze, then run:

diskonaut

You can also specify a path:

diskonaut /path/to/directory

Once launched, use arrow keys to navigate, Enter to zoom in, Backspace to zoom out, and 'd' to delete files or directories.

Competitor Comparisons

3,790

Fast disk usage analyzer with console interface written in Go

Pros of gdu

  • Faster performance, especially for large directories
  • Supports more platforms including Windows and FreeBSD
  • Offers a more traditional file explorer interface

Cons of gdu

  • Less visually appealing interface compared to diskonaut's unique visualization
  • Lacks some advanced features like real-time updates during file deletions

Code Comparison

gdu (Go):

func (a *App) askBeforeDelete(item *File, multiple bool) bool {
    var msg string
    if multiple {
        msg = fmt.Sprintf("Are you sure you want to delete %d items?", len(a.selected))
    } else {
        msg = fmt.Sprintf("Are you sure you want to delete %s?", item.Name)
    }
    return a.ui.Confirm(msg, "No", "Yes")
}

diskonaut (Rust):

fn delete_selected_files(&mut self) -> Result<()> {
    let files_to_delete: Vec<_> = self
        .selected_files
        .iter()
        .map(|selected_file| selected_file.path.clone())
        .collect();
    for file in files_to_delete {
        std::fs::remove_file(&file)?;
    }
    Ok(())
}

Both projects aim to provide disk usage analysis tools, but gdu focuses on speed and broad platform support, while diskonaut offers a unique visual representation of disk usage. gdu's interface is more traditional, while diskonaut provides an interactive treemap visualization.

12,655

Disk Usage/Free Utility - a better 'df' alternative

Pros of duf

  • Cross-platform support (Linux, macOS, Windows, *BSD)
  • Colorful and user-friendly output with various themes
  • Supports multiple units (binary/decimal) and grouping options

Cons of duf

  • Lacks interactive visualization capabilities
  • Does not provide detailed file-level analysis
  • Limited customization options for output format

Code Comparison

duf:

func (d *Device) UsedPercent() float64 {
    if d.Total == 0 {
        return 0
    }
    return float64(d.Used) / float64(d.Total) * 100.0
}

diskonaut:

pub fn get_percentage_string(percentage: f64) -> String {
    format!("{:.1}%", percentage.min(100.0))
}

Summary

duf is a disk usage utility that provides a colorful and user-friendly output across multiple platforms. It offers various themes and unit options but lacks interactive visualization and detailed file-level analysis.

diskonaut, on the other hand, focuses on interactive disk space visualization and navigation, allowing users to explore and analyze disk usage at a more granular level. However, it may have limited cross-platform support compared to duf.

Both tools serve different purposes: duf for quick disk usage overview, and diskonaut for in-depth disk space analysis and cleanup.

8,538

A more intuitive version of du in rust

Pros of dust

  • Written in Rust, potentially offering better performance and memory safety
  • Provides a simple command-line interface for quick disk usage analysis
  • Supports multiple sorting options and file type filtering

Cons of dust

  • Less visually appealing compared to diskonaut's interactive interface
  • Lacks the ability to delete files directly from the interface
  • May not be as intuitive for users who prefer graphical representations

Code comparison

diskonaut:

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let args = cli::get_cli_args();
    let path = args.path.unwrap_or_else(|| std::env::current_dir().unwrap());
    let mut app = app::App::new(path, args.apparent_size, args.reverse_delete)?;
    app.run()?;
    Ok(())
}

dust:

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let opt = Opt::from_args();
    let mut app = App::new(&opt);
    app.run()?;
    Ok(())
}

Both projects use Rust and have similar main function structures, but diskonaut's code suggests a more complex initialization process with additional parameters.

3,931

View disk space usage and delete unwanted data, fast.

Pros of dua-cli

  • Written in Rust, offering better performance and memory efficiency
  • Provides a command-line interface, making it easier to integrate into scripts and automation
  • Offers a more detailed breakdown of disk usage, including file counts and percentages

Cons of dua-cli

  • Less visually appealing interface compared to diskonaut's interactive UI
  • Lacks the ability to delete files directly from the interface
  • May be less intuitive for users who prefer graphical representations

Code Comparison

diskonaut:

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let args: Vec<String> = env::args().collect();
    let path = args.get(1).map(|s| s.as_str()).unwrap_or(".");
    let mut app = App::new(path)?;
    app.run()?;
    Ok(())
}

dua-cli:

fn main() -> Result<()> {
    let opt: Opt = Opt::from_args();
    let mut app = App::new(opt.input, opt.threads)?;
    app.run()?;
    Ok(())
}

Both projects use similar main function structures, but dua-cli incorporates command-line argument parsing using a custom Opt struct, while diskonaut uses a simpler approach with direct argument access.

2,155

A TUI system monitor written in Rust

Pros of ytop

  • Real-time system monitoring with CPU, memory, disk, and network usage
  • Customizable interface with different color schemes and layouts
  • Cross-platform support (Linux, macOS, Windows)

Cons of ytop

  • Lacks disk space visualization capabilities
  • No interactive file/directory management features
  • Less focused on disk usage analysis compared to diskonaut

Code Comparison

ytop (Rust):

pub fn draw<B: Backend>(&mut self, f: &mut Frame<B>) {
    let chunks = Layout::default()
        .direction(Direction::Vertical)
        .constraints([Constraint::Percentage(50), Constraint::Percentage(50)].as_ref())
        .split(f.size());
    self.draw_cpu(f, chunks[0]);
    self.draw_mem(f, chunks[1]);
}

diskonaut (Rust):

fn draw<B: Backend>(&mut self, f: &mut Frame<B>) {
    let chunks = Layout::default()
        .direction(Direction::Vertical)
        .constraints([Constraint::Percentage(100)].as_ref())
        .split(f.size());
    self.draw_disk_usage(f, chunks[0]);
}

Both projects use Rust and the tui-rs library for terminal-based user interfaces. ytop focuses on overall system monitoring, while diskonaut specializes in disk usage visualization and management. ytop offers a more comprehensive system overview, but diskonaut provides deeper insights into disk space utilization.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

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: aram@poor.dev

License

MIT