How to search a log file in Linux and escape special characters like square brackets (i.e. [
and ]
)
Can someone point me in the right direction on this?
I less
the log file as per below:
less system001A.LOG
Once I am in the log, I then press <
(i.e. the smaller-than sign), and then I press forward-slash (i.e./
) and type what I would like to search for:
/ERROR [section_NAME]
The problem is how to escape these brackets while I search? Because when I run this, it says no pattern/match is found, yet this in fact exists on the log.
/ERROR \[section_NAME\]