I want to use the output of command:
fdisk -l | grep -i "/dev"
But the problem is that it bold and highlight/color the matched output. I don't want that. I only want to print the lines that matched the criteria.
Your shell has probably a defined alias. alias grep='grep --color=auto'
is rather common in ~/.bash_aliases
or ~/.bashrc
. You can remove the alias or replace it with
grep --color=never
You can of course use grep --color=never
manually instead when you don't want colors, as it expands to grep --color=auto --color=never
and the latter option overrules the former.
See grep --help
, man grep
or info "(grep)General Output Control"
for more information.
unalias grep
or if that's not enough, usegrep --color=never