1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

findの結果にPermission deniedを表示しないようにしたい

Posted at

findの結果にPermission deniedを表示しないようにしたい

通常、例えばルートディレクトリ(/)などでfindすると権限の関係でPermission deniedが表示される事がある

$ find . -name test.sh
find: ./usr/sbin/authserver: Permission denied
find: ./.Spotlight-V100: Permission denied
find: ./.PKInstallSandboxManager-SystemSoftware: Permission denied
find: ./Library/Application Support/Apple/ParentalControls/Users: Permission denied
find: ./Library/Application Support/Apple/AssetCache/Data: Permission denied
find: ./Library/Application Support/ApplePushService: Permission denied
...
./Users/seigo/mkfile/test.sh

Permission deniedを無視したい場合、find . -name test.sh 2> /dev/nullのようにすればOK

$ find . -name test.sh 2> /dev/null 
./Users/seigo/mkfile/test.sh

(今回の場合は1つの例であり、検索対象をもともと絞っておくなどの別解があることは留意しておきたい)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?