0

sudo dmidecode | grep State 2> /dev/null

Boot-up State: Safe
    Power Supply State: Safe
    Thermal State: Safe
Invalid entry length (16). Fixed up to 11

I don't want the Invalid entry error in the output. How do I filter that?

1
  • You should put the redirect before the pipe symbol, not after. You're redirecting grep's standard error, but not dmidecode's. Commented Jan 27, 2018 at 1:44

1 Answer 1

2

As Wildcard commented, you've mistakenly redirected grep's stderr instead of sudo/dmidecode's. Use this instead:

 sudo dmidecode 2>/dev/null | grep State

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.