Wrapper for cd, but it creates parent directories specified in the target.
You can save the file as /usr/local/bin/bcd (short for better change directory) to run it as a command.
bcd this/path/doesnt/exist
Just like
cd, but creates parents. May not have somecdfeatures. Doesn’t support flags.
Because cd doesn’t work in scripts unless you use source, you need to add this to ~/.bashrc (or equivalent):
alias bcd='source /usr/local/bin/bcd'
Then run:
source ~/.bashrc
To reload
better-cpWrapper for cp, but it creates parent directories specified in the target.
You can save the file as /usr/local/bin/bcp (short for better copy) to run it as a command.
bcp /path/to/source /path/to/destination
Just like
cp, but creates parents. May not have somecpfeatures. Doesn’t support flags.
better-mvWrapper for mv, but it creates parent directories specified in the target.
You can save the file as /usr/local/bin/bmv (short for better move) to run it as a command.
bmv /path/to/source /path/to/destination
Just like
mv, but creates parents. May not have somemvfeatures. Doesn’t support flags.
cat-dirRuns cat on each file in the given directory. Best use-case is to read a bunch of small files quickly.
./cat-dir <dir1> [dir2] [dir3]
Example:
./cat-dir ~/GitHub/ ~/GitHub/NikoboiNFTB/Shell-Scripts/
bash cat-dir ~/GitHub/ ~/GitHub/NikoboiNFTB/Shell-Scripts/
Or if placed in /usr/local/bin/cat-dir (recommended):
cat-dir ~/GitHub/ ~/GitHub/NikoboiNFTB/Shell-Scripts/
find-fileSimple to use tool to find a file or folder anywhere in the current directory, while allowing you to ignore directories.
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"
find-stringSimilar to find-file but for file contents. Supports -b | --begin to find strings only at the beginning of lines.
linkifyFilter out everything except for links in a given file.
./linkify <file1> [file2] [file3]
Works with many files.
repeatRepeat any command every given seconds. Optionally also clear the terminal between each command.
bash repeat [--clear] <command_in_quotes> <interval_in_seconds>
Any order
Example:
repeat --clear "docker ps" 1
In this case the script has been placed in `/usr/local/bin/
Will run “ls -l” every five seconds, while clearing the terminal before each run.
This script is equivalent to running;
while true; do [clear &&] <command> && sleep <interval>; done
sortSort any file alphabetically.
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