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を探す
おすすめ情報
- ・漫画をレンタルでお得に読める!
- ・人生のプチ美学を教えてください!!
- ・10秒目をつむったら…
- ・あなたの習慣について教えてください!!
- ・牛、豚、鶏、どれか一つ食べられなくなるとしたら?
- ・【大喜利】【投稿~9/18】 おとぎ話『桃太郎』の知られざるエピソード
- ・街中で見かけて「グッときた人」の思い出
- ・「一気に最後まで読んだ」本、教えて下さい!
- ・幼稚園時代「何組」でしたか?
- ・激凹みから立ち直る方法
- ・1つだけ過去を変えられるとしたら?
- ・【あるあるbot連動企画】あるあるbotに投稿したけど採用されなかったあるある募集
- ・【あるあるbot連動企画】フォロワー20万人のアカウントであなたのあるあるを披露してみませんか?
- ・映画のエンドロール観る派?観ない派?
- ・海外旅行から帰ってきたら、まず何を食べる?
- ・誕生日にもらった意外なもの
- ・天使と悪魔選手権
- ・ちょっと先の未来クイズ第2問
- ・【大喜利】【投稿~9/7】 ロボットの住む世界で流行ってる罰ゲームとは?
- ・推しミネラルウォーターはありますか?
- ・都道府県穴埋めゲーム
- ・この人頭いいなと思ったエピソード
- ・準・究極の選択
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
スクリプトのエラー「unexpecte...
-
シェルスクリプト実行で”そのよ...
-
bad interpreterで、シェルが使...
-
複数存在するgrepについて
-
chmodをapplescriptで実行したい。
-
bashでシングルクォート内の変...
-
【UNIX】unzip がcron で作動し...
-
CygwinでX Windiws Systemが起...
-
LinuxのバーチャルIPアドレスの...
-
crontabでsql/plusの起動
-
SONYの音楽ソフト「x-アプリ」...
-
Dirコマンドでフォルダ内ファイ...
-
batである文字列内に特定の文字...
-
TOPコマンドで表示するCPU使用...
-
pingは正常なのにtracerouteで...
-
ラズパイで『’test.service’をs...
-
ファイル名についている「-」と...
-
エクセルの表にヘンな枠が・・・
-
ネットワークドライブ上のVBScript
-
テキストファイルから最終行の抽出
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
スクリプトのエラー「unexpecte...
-
bashでシングルクォート内の変...
-
Linux 月を英語表示したい
-
シェルスクリプト実行で”そのよ...
-
crontabでsql/plusの起動
-
apachectl start command not f...
-
ldapaddコマンドでエラー
-
Linuxでシェルスクリプトがフル...
-
ロケールをutf8からsjisにする...
-
自動パスワード入力でscpするス...
-
bad interpreterで、シェルが使...
-
シェルスクリプトで標準エラー...
-
sudoでシェルスクリプトを実行...
-
Linuxで自作バッチファイルの置...
-
cronの@rebootでのdateコマンド...
-
cronでシェルスクリプト実行時...
-
crontabで実行されない部分があ...
-
crontabでjavaだけが上手く動い...
-
UNIXのbashエラーでnot a valid
-
JAVAの環境変数が初期化されて...
おすすめ情報