/finderase

A Python Command Line Tool for finding Files and Folders and Erasing or Renaming Them

Primary LanguagePythonMIT LicenseMIT

FindErase

A Python Command Line Tool for locating Files and Folders and optionally Erasing or Renaming Them

Introduction

The Folder Search and Delete Tool is a Python script that allows you to search for and optionally delete specified folders or files within a directory. It is a versatile utility that can help you quickly locate specific folders and, if needed, remove them from your file system.

Usage

To use the Folder Search and Delete Tool, follow these steps:

  1. Installation:

    Clone this github repository

    ssh

    git clone git@github.com:briankeny/finderase.git
    
    
    Https
    
    ```bash
    git clone https://github.com/briankeny/finderase.git
    
    There is a standalone Python script. However, make sure you have Python installed on your system.
    
  2. Running the Script:

    Open your command-line terminal and navigate to the directory where you have saved the FINDERASE folder then run the finderase.py script.

    To search for a specific folder within the current directory, use the following command:

    python main.py  folder_name_to_search
    
    or 
    
    ```bash
    python main.py  folder_name_to_search -del yes
    
    
  3. Alternatively Note: This Only works for unix/linux like terminals or emulators

    Let's make the script executable

    Make Sure this shebang line is in finderase.py to point to your usr bin

    #!/usr/bin/env python3
    
    Make the script executable
    
    ```bash
    chmod +x finderase.py
    
    
    Run the script
    
    ```bash
    ./finderase.py folder_name
    
    
  4. Adding a Symlink --optional

    You can create a symbolic link (symlink) to make your Python script executable from anywhere in your terminal.

    To do this, follow these steps:

    Navigate to a directory that you cloned this repository

    Make the script Executable

    chmod +x finderase.py
    
    
    Create a symlink for finderase.py in the current directory
    
    ```bash
    ln -sf `pwd`/finderase.py   /usr/bin/finderase
    
    
    or
    
    ```bash
    ln -sf $pwd/finderase.py   /usr/bin/finderase
    
    
    or 
    
    ```bash
    pwd
    
    PATH_TO_CURRENT_DIRECTORY
    
    copy the value
    
    ```bash
    ln -sf PATH_TO_CURRENT_DIRECTORY/finderase.py   /usr/bin/finderase.py
    
    This method allows you to create a symlink to your finderase.py, making it easily executable from anywhere in your system.
    
    Call the script
    
    ```bash
    finderase  example_folder -del yes
    
    
  5. Usage --optional

    To learn more about usage of finderase.py, type

    finderase -h 
    
    
    or 
    
    ```bash
    ./finderase --help 

    or if you are running the script directly

    python finderase.py -h

    The above command will display the usage menu

    Open for contributions

    Thank You For Visiting. Goodbye ...