start

I once typed lt -la at 2AM and blamed the server for three minutes The shell was fine My fingers were not

Bash is a command language and a programming language at the same time Start with the command part

The prompt

printf 'hello\n'

Plain output, nothing clever The prompt is just a string that waits for a line

Exit status

Every command returns a number Zero means success Anything else means something went wrong

true && printf 'yes\n'
false || printf 'fallback\n'

Read that as: run the second command only when the first allows it Scripts live and die by this idea

Ask first

help set
man grep | head -n 40

help covers shell builtins man covers external programs Guessing a flag is slower than reading forty lines

A tiny physical fact

Commands do not remember state between shells unless you write it down Each new terminal is a clean slate That is a feature, not an annoyance

Next

Move around the filesystem in 02 navigation

Posted