๐ Bash Dictionary
Every keyword, operator, and symbol explained.
#!/bin/bash shebangFirst line โ tells OS to use bash interpreter.
#!/bin/bash
set -e optionExit immediately if any command fails.
set -e
set -u optionTreat unset variables as errors.
set -u
syntaxExpands variable value. Always quote: .
echo
syntaxCommand substitution โ runs command, uses output.
DATE=2026-09-17
| operatorPipe โ passes stdout to stdin of next command.
ls | grep go
> operatorRedirect stdout to file, overwriting it.
echo hi > file.txt
>> operatorRedirect stdout, appending to file.
echo hi >> log.txt
&& operatorRun next only if previous succeeded.
make && ./run
if/then/fi syntaxConditional โ runs block if condition true.
if [ -f f ]; then echo ok; fi
for/do/done syntaxLoop over list or glob.
for f in *.txt; do echo ; done
echo commandPrints text to stdout.
echo Hello
grep commandSearches for pattern in files or stdin.
grep -r error logs/
find commandFinds files matching criteria.
find . -name *.log -delete
curl commandTransfers data from/to URLs.
curl -sL https://example.com