
No.1ベストアンサー
- 回答日時:
rootでしか実行出来ませんがlsof(8)はどうですかね?
以下のlsofのオンラインマニュアルの抜粋にある通り、lsofを実行し出力のFDの項目を見ればロックされているかどうかが分かります。
------8<-------8<------8<-------8<-------8<------
FD is followed by one of these characters, describing the
mode under which the file is open:
r for read access;
w for write access;
u for read and write access;
space if mode unknown and no lock character follows;
`-' if mode unknown and lock character follows.
The mode character is followed by one of these lock characters, describing the type of lock applied to the file:
N for a Solaris NFS lock of unknown type;
r for read lock on part of the file;
R for a read lock on the entire file;
w for a write lock on part of the file;
W for a write lock on the entire file;
u for a read and write lock of any length;
U for a lock of unknown type;
x for an SCO OpenServer Xenix lock on part of the file;
X for an SCO OpenServer Xenix lock on the entire file;
space if there is no lock.
------8<-------8<------8<-------8<-------8<------
以下、Fedora CORE 3での実行例です。
(たぶん、見難いとは思いますが。。。)
------8<-------8<------8<-------8<-------8<------
# lsof | egrep " [0-9]*[rwu\-][NrRwWuUxX] "
nifd 3563 root 4uW REG 253,0 5 1080653 /var/run/nifd.pid
mDNSRespo 3593 nobody 10uW REG 253,0 5 1080655 /var/run/mDNSResponder.pid
sendmail 3793 root 5wW REG 253,0 33 1080751 /var/run/sendmail.pid
sendmail 3801 smmsp 4wW REG 253,0 50 1084009 /var/run/sm-client.pid
anacron 3905 root 4uW REG 253,0 9 1084745 /var/spool/anacron/cron.daily
anacron 3905 root 5uW REG 253,0 0 1084747 /var/spool/anacron/cron.monthly
atd 3914 root 3uW REG 253,0 5 1084699 /var/run/atd.pid
gconfd-2 4562 lean 12wW REG 253,0 649 214373 /tmp/gconfd-lean/lock/0t1112092337ut33437u500p4562r2059905881k3220550124 (deleted)
------8<-------8<------8<-------8<-------8<------
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
スクリプトのエラー「unexpecte...
-
Linux 月を英語表示したい
-
bashでシングルクォート内の変...
-
シェルスクリプト実行で”そのよ...
-
macのターミナルからemacsを開...
-
crontabでsql/plusの起動
-
Linuxでシェルスクリプトがフル...
-
Cronジョブの終了時刻を簡単に...
-
Linuxで自作バッチファイルの置...
-
Cシェルのかっこいいプロンプト...
-
Homebrewをインストールしたの...
-
UNIXのbashエラーでnot a valid
-
Dirコマンドでフォルダ内ファイ...
-
TOPコマンドで表示するCPU使用...
-
batである文字列内に特定の文字...
-
ファイル名についている「-」と...
-
pingは正常なのにtracerouteで...
-
SONYの音楽ソフト「x-アプリ」...
-
Linux環境 grepで改行コード(CR...
-
Linux のシェルスクリプトの強...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
スクリプトのエラー「unexpecte...
-
bashでシングルクォート内の変...
-
シェルスクリプト実行で”そのよ...
-
Linux 月を英語表示したい
-
Linuxでシェルスクリプトがフル...
-
サーチPathに付きまして
-
ロケールをutf8からsjisにする...
-
crontabでsql/plusの起動
-
cronでの処理が途中で中断終了...
-
自動パスワード入力でscpするス...
-
apachectl start command not f...
-
Telnetのメニュー選択形式
-
solarisの環境
-
crontabでjavaだけが上手く動い...
-
ルートのパスワードを変更する...
-
DebianLinuxのコマンドプロンプ...
-
AWSのEC2のZabbixユーザーでaws...
-
CygwinでX Windiws Systemが起...
-
Linuxで自作バッチファイルの置...
-
cronの@rebootでのdateコマンド...
おすすめ情報