0

I'd like to find the "cpuinfo" file and tried

$ find / -iregex ".*cpuinfo.*" 2>/dev/null &
[1] 7996

However, it still print results to the console

$ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/cpuinfo.rb
/usr/local/lib/python3.6/site-packages/numpy/distutils/cpuinfo.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/__pycache__/cpuinfo.cpython-36.pyc
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/distutils/cpuinfo.py
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/distutils/cpuinfo.pyc

How to hide them entirely background?

2
  • 4
    What is the purpose of this?
    – jesse_b
    Commented Jul 29, 2018 at 2:35
  • Where do you want to print the search result? This command with full output redirected to /dev/null makes no sense.
    – Bob
    Commented Jul 29, 2018 at 3:22

2 Answers 2

3

If you want to hide all output you can redirect stdin and stdout:

find / -iregex ".*cpuinfo.*" >/dev/null 2>&1 &

Or with bash:

find / -iregex ".*cpuinfo.*" &>/dev/null &
0
0

To have result of the "cpuinfo" file search available with errors suppressed, execute the command find with screen utility.

Just start your search with screen detached:

screen -dm find / -iregex ".*cpuinfo.*" 2>/dev/null

To reattach screen with the command runnung do

screen -r

Since leading dollar sign $ is present in your command and search will be performed inside root /, consider to execute find with sudo or as root user.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .