Using the command grep vs /usr/bin/grep
Why does using the command 'grep' automatically highlight words/letters?
When you use the 'grep' command without specifying the full path (i.e., just typing 'grep' in the terminal), it refers to the version of 'grep' that is located in the system's default search path, usually in '/bin' or '/usr/bin'. This version of 'grep' is often an alias or symlink to an enhanced version that includes additional options, such as automatic highlighting of matching words or letters. On the other hand, using the full path '/usr/bin/grep' calls a specific version that may not have the highlighting feature enabled, resulting in no automatic highlighting.
Explanation:
The 'grep' command is a powerful tool used in Unix-like operating systems for searching text patterns within files. When you enter 'grep' in the terminal, the system searches for this command in the default directories like '/bin' or '/usr/bin'. Most often, the version of 'grep' found in these directories is an alias or symlink to a more feature-rich version of 'grep' that includes automatic highlighting of matching words or letters.