rahman
rahman

Reputation: 4948

what does a backslash followed by grep mean?

I am following an impatient way of learning and working with bash scripts, in this link I saw a line like this:

INSTALLED=$(dpkg -l \grep $1)

can you tell me what \grep means?

thanks

Upvotes: 3

Views: 270

Answers (1)

anubhava
anubhava

Reputation: 785316

\grep means execute system default grep from /bin/grep OR /usr/bin/grep ignoring all local environment aliases you may have set up for grep.

  • You can put backslash before any BASH command to ignore aliases with the same name.

Example:

> alias grep=date
> grep
Thu Nov 28 22:49:57 EST 2013
> \grep
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

Upvotes: 5

Related Questions