Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

Ametrine-cc/Search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Search

A simple, recursive file search tool written in C++. Currently, it only supports searching for linux and other unix-like / unix-based systems, as Windows has not been tested or accounted for as a supported platform.

Features

  • Recursively searches directories for specified file names.
  • Supports a --debug flag to enable verbose logging.
  • Outputs the full path to any found files.

Usage

search <file_or_directory_name> [--debug|--full]

Arguments

  • <file_or_directory_name>: The name of the file or directory to search for.
  • --debug: Enables debug logging, showing detailed scan progress and potential errors. Currently just adds pretty colors.
  • --full: Searches all directories, not just the current one, enters subdirectories it finds along the way.

Extra information: If specifying a file must add file extension for specific file types, not adding any extension will search for all files and directories with that name.

Example

To search for .cc files in the current directory and its subdirectories (.cc being a c++ file extention), with debug logging enabled:

> search .cc --full --debug
search | Found : ./src/main.cc
search | Found : ./src/logs.cc
search | Found : ./build/CMakeFiles/search.dir/src/main.cc.o.d
search | Found : ./build/CMakeFiles/search.dir/src/logs.cc.o.d
search | Found : ./build/CMakeFiles/search.dir/src/logs.cc.o
search | Found : ./build/CMakeFiles/search.dir/src/main.cc.o
...

Installation & Requirements

To install search you need the following:

  • cmake - A cross-platform build system.
  • gcc or clang - A C++ compiler.
  • sudo - A command-line utility for executing commands with administrative privileges.

To install from source follow these steps:

  1. Clone the repository:
git clone https://github.com/Ametrine-cc/search.git
cd search
  1. Build the project:
cmake -B build && cmake --build build
  1. Install the binary:
sudo make --install build

# done!!!

To install with the install.sh script, run:

  1. Clone the repository:
git clone https://github.com/Ametrine-cc/search.git
cd search
  1. Run the installation script
chmod +x install.sh
./install.sh

# done!!!

Uninstallation

To uninstall the binary, run:

sudo rm -rf /usr/local/bin/search $HOME/.config/search

Configuration file

The configuration file is located at ~/.config/search/config.lua. To customize search, you can modify this file. Using the following format:

local use_config = true

local explore_all = true

use_config

If use_config is true, search will use the configuration file. If false, search will use default settings.

explore_all

If explore_all is true, search will explore all files in the current directory. If false, search will only explore files in the current directory that match the search query.

Development

This project was built using C++.

License

This project is licensed under the GPLv3 license. See LICENSE License source for more details.

About

A simple file and directory search tool

Topics

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Contributors