Coder Social home page Coder Social logo

delly's Introduction

Delly: File Cleanup Tool

Delly is a command-line utility designed to help you efficiently clean up your file system by recursively deleting files with specific file extensions in a given directory. This tool is especially handy when you need to reclaim storage space by removing files matching certain criteria.

Table of Contents

Installation

To use Delly, you'll need to have it installed on your system. You can do this by following these steps:

1 Install the binary into your GOBIN with go install:

go install github.com/bxffour/delly@latest

Now, Delly is ready to use on your system.

Usage

Delly is simple to use and takes two main parameters: file extension(s) to match and a directory to start the search from. Here's the basic usage:

delly -e <extensions> <directory>
  • -e <extensions>: Specify the file extensions to match, separated by commas (e.g., "mp4,zip").
  • <directory>: Provide the directory where Delly should begin its search for matching files.

Delly will then provide a list of matching files along with their sizes and ask for your confirmation before deleting them. Additionally, it reports the bytes saved per directory after the deletion process.

Example

Let's walk through a typical usage scenario. Suppose you want to delete all .mp4, ttf and .zip files from your ~/Downloads directory:

delly -e mp4,zip,ttf ~/Downloads

Delly will display a list of matching files, their sizes, and ask for your confirmation before proceeding with the deletion. After successfully deleting the files, it will report the bytes saved per directory.

Output:

FILE                                                                                  SIZE
----                                                                                  ----
/home/user/Downloads/go1.21.1.linux-amd64.tar.gz                                         67 MB
/home/user/Downloads/Cantarell.zip                                                       185 kB
/home/user/Downloads/Inter.zip                                                           3.6 MB
/home/user/Downloads/JetBrainsMono-2.304/fonts/variable/JetBrainsMono-Italic[wght].ttf   309 kB
/home/user/Downloads/JetBrainsMono-2.304/fonts/variable/JetBrainsMono[wght].ttf          303 kB
/home/user/Downloads/JetBrainsMono-2.304.zip                                             5.6 MB
/home/user/Downloads/bundleservice.zip                                                   12 MB
----                                                                                  ----
TOTAL                                                                                 89 MB

do you want to go ahead with deleting these files? [y/n]: y

DIRECTORY                                              OLDSIZE     NEWSIZE     BYTES SAVED
---------                                              -------     -------     -----------
/home/user/Downloads                                      332 MB      244 MB      88 MB
/home/user/Downloads/JetBrainsMono-2.304/fonts/variable   612 kB      0 B         612 kB

Contributing

We welcome contributions to Delly! If you find a bug, have an idea for an improvement, or want to add a new feature, please open an issue or create a pull request on the Delly GitHub repository.

License

Delly is open-source software licensed under the MIT License. You are free to use, modify, and distribute this tool according to the terms of the license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.