4
rated 0 times
[
4]
[
0]
/ answers: 1 / hits: 643
/ 3 Years ago, mon, september 13, 2021, 10:19:28
I have a command example,
device list
which gives me all devices with their status as okay or error in the following format
[okay ]: you are listening on : 11
[error ]: not currently listening: 22
[error ]: not currently listening: 33
[okay ]: you are listening on : 111
I want to print only devices that has status as okay.
I tried using grep command as
device list | grep -r 'okay'
device list | grep -r '[okay ]'
device list | grep -r '^okay'
device list | grep 'okay'
But it didn't print any output.
How can I print the devices with status as okay.
Thanks in advance.
More From » command-line