I am trying to make a bash alias to grep for Git conflicts within files after a merge occurs. Usually on the command line with bash shell, I run grep -nr '<<<<<<<', where the single-quotes are needed to escape the special characters.

My ~/.bashrc file has this so far:

alias confs="grep -nr \'<<<<<<<\'"

However, the output when runing confs command is

bash: syntax error near unexpected token `<<<'.

How do I do this? Thanks

  • 1
    Welcome, Does not alias confs="grep -nr '<<<<<<<'" accomplish what you want? ` Commented Jan 15, 2021 at 2:17

1 Answer 1


The solution was very simple thanks to schrodigerscatcuriosity. The way to do this would be: alias confs="grep -nr '<<<<<<<'". No extra escape characters are needed

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .