Interview Prep/Shell Scripting/Shells, scripts and execution

Why is it a bad idea to name a script `test` or a function `ls`?

BeginnerConceptShells, scripts and execution
Answer

test is a shell builtin ([ is the same command), so typing test runs the builtin and your script silently does nothing. Functions shadow commands too: a function named ls or cd in a sourced library changes behaviour for every later caller. Use unique, prefixed names (opskit_backup, deploy_rollout), and call the real command with command ls when you deliberately wrap one.

All Shell Scripting questions Roadmap: Shell scripting (Bash)

More on Shells, scripts and execution