Time diff |
Time difference HH:mm:ss |
Calculate time difference |
Time now |
Current time |
Print current time on the format HH:mm:ss |
Time in future |
Add to current time |
Add to current time |
File exists |
Checks if a file is found |
Checks if a file is found |
Dir exists |
Checks if a directory is found |
Checks if a Directory is found |
List files |
Iterate files in directory |
Walk through each file name in a directory |
List dirs |
Iterate only directories in directory |
Walk through each sub-directory name in a directory |
List files recursive |
Iterate files in directory recursive |
Iterate file names in directory recursive. That is, walking through sub-directories also. |
List files recursive reg |
Iterate files in directory recursive regex |
Iterate file names in directory recursively using regex. That is, walking through sub-directories also. |
List dirs recursive |
Iterate directories in directory |
Iterate directory names in directory recursively. That is, walking through sub-directories also. |
compare filenames in dir |
Compare file names in two directories |
Compare file names in two directories and prints out matching or missing file names |
Get script dir |
Script directory |
Get path to the the current bash file |
Get script name |
Script Name |
Get name of current script |
Get file name |
Extract filename |
Extracts filename name from a file path |
Get file directory |
Extract file directory |
Extracts directory from a file path. |
Get file extension |
Extract file extension |
Extract file extension from a file path. |
read text file |
Read on line at a time |
Read a text file one line at a time |
iniGetSectionKeyValue, getIniSectionKeyValue |
Get a value from ini file |
Get a value of a key(variable) under specified section in a configuration file |
iniSetSectionKeyValue, setIniSectionKeyValue |
Set a ini file value |
Add or change a section key value pair in a file |
bash, #!, shebang, start |
Start of bash |
Start of bash |
#Created |
File creation time |
File creation time |
Source sh |
source sh |
Import another another shell script |
declare array |
declare array |
Declare a new array and add initialize it. |
TextColors |
Text Color commands |
Text Color commands |
function |
Function |
Create a function which takes no argument |
function 1 argument |
Function 1 argument |
Create a function which takes 1 argument |
function 2 arguments |
Function 2 arguments |
Create a function which takes 2 arguments |
function 3 arguments |
Function 3 arguments |
Create a function which takes 3 arguments |
Print help |
Script help function |
Script help function |
Print help, one option |
Help function with one option |
Help function with one option |
Print help, one option, one option argument |
Help function with one option and one option argument |
Help function with one option and one option argument |
Boilerplate 1 |
Boilerplate simple |
Boilerplate simple Hello bash world |
Boilerplate 2 |
Boilerplate, simple one option |
Boilerplate bash script with help that accepts one optional parameter |
Boilerplate 3 |
Boilerplate, one option, one option argument |
Boilerplate with one option and one option which requires a argument |
parseOptions |
Check if all options are valid and saves each in a variable |
Check if all options are valid and saves each in a variable |
IsSuper |
Only allow super user to run this script |
Only allow super user to run this script |
frame |
Frame your text |
Frame your text |
menuOptions |
Select pre defined option |
Select pre defined option |
arrayContains |
Searches for an string within an array of strings |
Searches for an string within an array of strings |
for number |
For number loop |
For loop with a number condition variable |
for number braces |
For number in braces |
For loop with brace expancion |
case example |
Case Example |
Case Statement Example |
case |
Case |
Case statement |
String prefix length |
Prefix search known length |
Check if a string starts with a specific text and is of a specific lengthS |
String starts with |
Prefix search with wildcard |
Check if string starts with using wild card |
String ends with |
Postfix search |
Check if string ends with |
string cut |
Substring with cut |
Examples when extracting substring from a string using cut. (For when bash version is old) |