The following will output only what is between brackets. grep -o -e "{[^}]*}" My original formulation used "{.*}", but with that the widest bracket found within a line, not the smallest one would be returned...