Another example would be test or [, which might override those commands in shell scripts, if your shell doesn't have those as built-ins.
If you're looking in someone else's home directory (or /tmp), and type just gcc or ls, you want to know you're running the real one, not a malicious version your prankster friend has written which erases all your files. The literal answer is as others have given: because the current directory isn't in your $PATH.īut why? In short, it's for security.