find コマンドが /sys/devices/ に繰り返しファイルが見つかりません。

find コマンドが /sys/devices/ に繰り返しファイルが見つかりません。

私はディレクトリ内のfindファイルを見つけるために使用しますcpuinfo_max_freq/sys/devices/

これは私が使用するコマンドであり、どの出力も表示しません。

find /sys/devices/ -name 'cpuinfo_max_freq'

また、リンクされたディレクトリ内で検索するために-Lフラグを追加しようとしましたが、うまくいかなかったように見え、出力を続けて完了しません。しかし、ルートディレクトリ()を見るとうまく/いきます。

物理ファイルのパスは次のとおりです。

/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq

ベストアンサー1

パス/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freqにはシンボリックリンクコンポーネントが含まれています。

$ namei -l /sys/devices/system/cpu/cpu1/CPU周波数/cpuinfo_最大周波数
f: /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq
drwxr-xr-xrootroot/
dr-xr-xr-x ルートルートシステム
drwxr-xr-x ルートルートデバイス
drwxr-xr-x ルートルートシステム
drwxr-xr-x ルート ルート CPU
drwxr-xr-x ルート CPU1
lrwxrwxrwx ルートルートcpufreq -> ../cpufreq/policy1
drwxr-xr-x ルートルート..
drwxr-xr-x ルート CPUfreq
drwxr-xr-x ルートルートポリシー 1
-r--r--r-- root root cpuinfo_max_freq

そのファイルの標準パスは次のとおりです。

$ readlink -f /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq
/sys/devices/system/cpu/cpufreq/policy1/cpuinfo_max_freq

パスは、次から返されるパスの1つです。

$/sys/devices/ -name 'cpuinfo_max_freq'を探す
/sys/devices/system/cpu/cpufreq/policy6/cpuinfo_max_freq
/sys/devices/system/cpu/cpufreq/policy4/cpuinfo_max_freq
/sys/devices/system/cpu/cpufreq/policy2/cpuinfo_max_freq
/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_max_freq
/sys/devices/system/cpu/cpufreq/policy7/cpuinfo_max_freq
/sys/devices/system/cpu/cpufreq/policy5/cpuinfo_max_freq
/sys/devices/system/cpu/cpufreq/policy3/cpuinfo_max_freq
/sys/devices/system/cpu/cpufreq/policy1/cpuinfo_max_freq

-Lオプションまたは述語を渡さない限り、引数として指定された-followパスfindにルートを含むディレクトリツリーを下げると、シンボリックリンクに従わないでください。

find -L/sys/devices/system/node/node0/cpu1/cpufreq/cpuinfo_max_freq結局のところ、それを見つけるでしょう(、、、 ... /sys/devices/system/memory/memory8/node0/cpu1/cpufreq/cpuinfo_max_freq/sys/devices/system/node/node0/subsystem/devices/node0/subsystem/devices/node0/cpu1/cpufreq/cpuinfo_max_freqそして他の多くのパスと一緒に)。しかし、findwithにも多くのシンボリックリンクが含まれているため、迷子になり、-Lその一部はループを引き起こします。/sys/devices/sys

おすすめ記事