Skip to content

Analyze and display the top files and folders in the specified directory.

License

Notifications You must be signed in to change notification settings

GirishCodeAlchemy/TopNDiskAnalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📁 TopNDiskAnalyzer 🚀

Top N Disk Analyzer

🚀 Analyze and display the top files and folders in the specified directory. 🚀

Description

TopNDiskAnalyzer is a concurrent file analysis tool written in Go. This tool provides insights into the top files and folders within a specified directory, allowing users to customize the number of top results. Leveraging goroutines and channels, it efficiently processes files concurrently, providing a scalable solution for analyzing file systems.

Features

  • Concurrently analyzes files and folders.
  • Customizable to display the top N files and folders.
  • Utilizes goroutines and channels for concurrent processing.
  • Provides file size information in a human-readable format.

Installation

Download Binary

You can download the precompiled binary for your operating system from the releases page.

Linux

# 64-bit
wget https://github.com/GirishCodeAlchemy/TopNDiskAnalyzer/releases/download/v1.0.0/tdf-linux-amd64 -O tdf
chmod +x tdf
sudo mv tdf /usr/local/bin/

# 32-bit
wget https://github.com/GirishCodeAlchemy/TopNDiskAnalyzer/releases/download/v1.0.0/tdf-linux-386 -O tdf
chmod +x tdf
sudo mv tdf /usr/local/bin/

macOs

# 64-bit
wget https://github.com/GirishCodeAlchemy/TopNDiskAnalyzer/releases/download/v1.0.0/tdf-darwin-amd64 -O tdf
chmod +x tdf
sudo mv tdf /usr/local/bin/

Windows

Download the tdf.exe from the releases page.

Build from Source

If you prefer to build from source, make sure you have Go installed. Clone the repository and run the following commands:

git clone https://github.com/GirishCodeAlchemy/TopNDiskAnalyzer.git
cd TopNDiskAnalyzer
go build -o tdf main.go
sudo mv tdf /usr/local/bin/

Usage

tdf [options] [directory_path]

Options

  • -dir: Specifies the directory path. Defaults to the current directory.
  • -top: Specifies the number of top items to display. Defaults to 10.
  • -help: Displays help information about the program and its options.

The command recursively analyzes the specified directory, calculating the sizes of files and folders, and then displays the top items based on their sizes in descending order.

Examples

# Analyze the current directory, display top 10 items
tdf

# Analyze a specific directory, display top 15 items
tdf -dir /path/to/directory -top 15

# Analyze a specific directory (using positional argument), display top 10 items
tdf /path/to/directory

Screenshots

1. Help command

Help command

2. Relative path

Relative path

3. Absolute path

Absolute path

4. Top option

Top option

Contributing

Feel free to contribute to the project by submitting issues or pull requests.

License

This project is licensed under the MIT License. See the LICENSE file for details.