Shell-Scripts

Shell Scripts

Miscellanious utility scripts.

Scripts

find-file

Simple to use tool to find a file or folder anywhere in the current directory, while allowing you to ignore directories.

Usage

Simply save the script in any folder and run:

bash find-file file1 file2 -i dir1 dir2

For example, if I want to find all README* files, except from my repositories:

bash find-file README* -i NikoboiNFTB

Much easier than running;

find . \( -name "README.md" -o -name "README.txt" -o -name "README" \) | grep -Ev "NikoboiNFTB"

sort

Sort any file alphabetically.

Usage

Save the script and run it anywhere:

bash sort <file>

This is a general use version of the sort file from NikoboiNFTB/DeSlop/block/sort

Installation

You can install any one of the scripts into any folder by running:

wget https://shell.nikoboi.dev/utils/*

Fill in the path to the script. shell.nikoboi.dev resolves to this repository.

Power User Tip

Place any script in /usr/local/bin/ for easy access anywhere:

sudo mv script /usr/local/bin/script

This will allow you to easily run the script as any other Linux command:

script

Very much recommended for scripts you use a lot in many different folders.

WARNING

Make sure you don’t overwrite anything in /usr/local/bin/ or that the filename isn’t a command:

  1. You can easily make sure there isn’t a file with the name by running;
cat /usr/local/bin/script-name
  1. Or any such command:
script-name