Run fallback command when previous command fails.
Section: Shell Basics
Run fallback command
bash
bash
grep -q needle file.txt || echo 'not found'Explanation
Use || for error handling or defaults.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Shell Basics