Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
スクリプトで stat を 2 回使用して、1 回はファイル ファイルのアクセス許可を検索し、もう 1 回はファイルのサイズを検索します。
`stat -c %A "$directory/$file"` `stat -c %s "$directory/$file"`
私はOSX 10.7を使用しており、ディレクトリとファイルは現在のディレクトリとファイルの変数です。
Darwinは、GNU 拡張であるため、 ではなく引数をstat使用します。-f-c
stat
-f
-c
homebrew、macports、またはfinkから gnu binutils をダウンロードしgstat、stat.
gstat
gnu binutils をインストールせず、標準の BSD ツールを使用したい場合は、次のようにします。
stat -f%p t.c
モードを (8 進数で) 返します。
stat -f%z t.c
サイズを返します。