tanacasinoのメモ

what are you waiting for ?

find コマンドのメモ その2

ファイルサイズの指定について、ものすごい恥ずかしいことをしてた。 「+10000000k」のように「k」で指定していたけど、MとGも使えるってことに今更気づいてしまったので・・・。

`b'    for 512-byte blocks (this is the default if no suffix is used)
`c'    for bytes
`w'    for two-byte words
`k'    for Kilobytes (units of 1024 bytes)
`M'    for Megabytes (units of 1048576 bytes)
`G'    for Gigabytes (units of 1073741824 bytes)
# 10MB以上のファイルを検索
$ find -type f -size +10M

# 1GB以上のファイルを検索
$ find -type f -size +1G

Kilobytes の場合だけ、小文字な点が紛らわしいですね。何か理由があるんでしょうか?もしくはこういう類のコマンドの慣習ですかね。覚えにくいのが悪い。と言い訳します。