| ホーム >> | ソフトウェア >> | Mac OS X 便利コマンド |
osascript -e 'tell app "Finder" to sleep'
参考:Mac OS X Mailing List[macosx-jp:16228]
ディスクに関する情報を見る。
% diskutil list
/dev/disk0
#: type name size identifier
0: Apple_partition_scheme *37.3 GB disk0
1: Apple_partition_map 31.5 KB disk0s1
2: Apple_Driver43 28.0 KB disk0s2
3: Apple_Driver43 28.0 KB disk0s3
4: Apple_Driver_ATA 28.0 KB disk0s4
5: Apple_Driver_ATA 28.0 KB disk0s5
6: Apple_FWDriver 256.0 KB disk0s6
7: Apple_Driver_IOKit 256.0 KB disk0s7
8: Apple_Patches 256.0 KB disk0s8
9: Apple_HFS MacOSX 26.1 GB disk0s9
10: Apple_HFS swap 1023.9 MB disk0s10
11: Apple_HFS Docs 10.1 GB disk0s11
/dev/disk1
#: type name size identifier
0: Apple_partition_scheme *5.6 GB disk1
1: Apple_partition_map 31.5 KB disk1s1
2: Apple_Driver43 28.0 KB disk1s2
3: Apple_Driver43 28.0 KB disk1s3
4: Apple_Driver_ATA 28.0 KB disk1s4
5: Apple_Driver_ATA 28.0 KB disk1s5
6: Apple_FWDriver 256.0 KB disk1s6
7: Apple_Driver_IOKit 256.0 KB disk1s7
8: Apple_Patches 256.0 KB disk1s8
9: Apple_HFS HD01 5.6 GB disk1s9
例えば、外付けハードディスク HD01 をアンマウントするには、
% diskutil unmount disk1s9とすれば良い。この状態でFireWireケーブルを抜くことができる。マウントするには、
% diskutil mount disk1s9とすれば良い。ディスクにあるパーティションを全てマウント、アンマウントするには、
% diskutil mount disk1を使うと良い。
% diskutil unmount disk1
/Developer/Tools/SetFile コマンドを用いると、様々なファイルの属性をセットすることができる。例えば可視ファイルを不可視にするには、
% /Developer/Tools/SetFile -a V foo.txt
とする。 また可視にしたいなら、オプションのVを小文字のvにすれば良い。その他の設定(エイリアス、アイコン、ロック等)についても
% man SetFile
をみて確認できる。
ファイル属性以外にも、クリエータの設定
% /Developer/Tools/SetFile -c "MSIE"
ファイルタイプの設定
% /Developer/Tools/SetFile -t "TEXT"
作成日時の設定
% /Developer/Tools/SetFile -d "2/16/2002 14:15"
修正日時の設定
% /Developer/Tools/SetFile -m "5/13/2001 5:39"
などができます。これらの属性を確認するには、
% /Developer/Tools/GetFileInfo foo.txt
とする。