Bash Scripting Guides and Tips

Created Friday 02 March 2018

Little Bash tricks - Unorganized little things I've found useful

General guides

Bash Beginners Guide
Advanced Bash Guide
Another good walkthrough of Bash


Basic, but specific, commands and functions

Brackets, Parentheses and Curly Braces, oh my

On "conditionals" in Bash (how to use if statements)
Conditional Expressions
http://mywiki.wooledge.org/BashFAQ/031

"For" loops in Bash
https://www.cyberciti.biz/faq/bash-for-loop/

For, While, and Until
https://linuxnewbieguide.org/for-while-and-until-loops/

The "DATE" command*
https://www.cyberciti.biz/tips/linux-unix-get-yesterdays-tomorrows-date.html
*Note, one bit that they don't talk about here is %s, which is the date as number of seconds since Jan 1, 1970. I find this really cool and useful, makes it easy to calculate time differences

SED (which is really another language, but heavily used with bash)
https://linuxconfig.org/learning-linux-commands-sed

AWK (which is also really another language, but also heavily used with bash)
https://www.tutorialspoint.com/awk/awk_basic_examples.htm

Lists of quirks and cool things that other people have put together

(I've tried to do this roughly in order from "useful" to "obscure")
https://zwischenzugs.com/2018/01/06/ten-things-i-wish-id-known-about-bash/
https://stackoverflow.com/questions/965663/useful-bash-code-snippets
https://www.lopezferrando.com/30-interesting-shell-commands/
https://github.com/alexanderepstein/Bash-Snippets
http://www.pixelbeat.org/programming/shell_script_mistakes.html
https://www.reddit.com/r/commandline/comments/3wiozw/what_is_your_favorite_commandline_cheatsheet/
http://www.etalabs.net/sh_tricks.html



FINALLY - WAY MORE OF THESE THAN YOU WILL EVER NEED


https://github.com/awesome-lists/awesome-bash



Backlinks: Tech Guides