Novell LINUX ENTERPRISE SERVER 10 - INSTALLATION AND ADMINISTRATION 04-08-2006 Installation Manual page 340

Table of Contents

Advertisement

Older events are logged in the files /var/log/messages and /var/log/warn.
17.7.5 List of Open Files: lsof
To view a list of all the files open for the process with process ID PID, use -p. For
example, to view all the files used by the current shell, enter:
tester@linux:~> lsof -p $$
COMMAND
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
The special shell variable $$, whose value is the process ID of the shell, has been used.
The command lsof lists all the files currently open when used without any parameters.
Because there are often thousands of open files, listing all of them is rarely useful.
However, the list of all files can be combined with search functions to generate useful
lists. For example, list all used character devices:
tester@linux:~> lsof | grep CHR
bash
bash
340
Installation and Administration
PID
USER
FD
5552 tester
cwd
5552 tester
rtd
5552 tester
txt
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
mem
5552 tester
0u
5552 tester
1u
5552 tester
2u
5552 tester
255u
3838
tester
3838
tester
TYPE DEVICE
SIZE
DIR
3,3
1512 117619 /home/tester
DIR
3,3
584
REG
3,3
498816
REG
0,0
REG
3,3
217016 115687 /var/run/nscd/passwd
REG
3,3
208464
REG
3,3
882134
REG
3,3 1386997
REG
3,3
13836
REG
3,3
290856
REG
3,3
26936
REG
3,3
190200
REG
3,3
54
REG
3,3
2375
REG
3,3
290
REG
3,3
52
REG
3,3
34
REG
3,3
62
REG
3,3
127
REG
3,3
56
REG
3,3
23
REG
3,3
21544
REG
3,3
366
REG
3,3
97165
CHR
136,5
CHR
136,5
CHR
136,5
CHR
136,5
0u
CHR
136,0
1u
CHR
136,0
NODE NAME
2 /
13047 /bin/bash
0 [heap] (stat: No such
11867 /usr/lib/locale/en_GB.
11868 /usr/lib/locale/en_GB.
8837 /lib/libc-2.3.6.so
8843 /lib/libdl-2.3.6.so
12204 /lib/libncurses.so.5.5
13004 /lib/libhistory.so.5.1
13006 /lib/libreadline.so.5.
11842 /usr/lib/locale/en_GB.
11663 /usr/lib/locale/en_GB.
11736 /usr/lib/locale/en_GB.
11831 /usr/lib/locale/en_GB.
11862 /usr/lib/locale/en_GB.
11839 /usr/lib/locale/en_GB.
11664 /usr/lib/locale/en_GB.
11735 /usr/lib/locale/en_GB.
11866 /usr/lib/locale/en_GB.
9109 /usr/lib/gconv/gconv-m
9720 /usr/lib/locale/en_GB.
8828 /lib/ld-2.3.6.so
7 /dev/pts/5
7 /dev/pts/5
7 /dev/pts/5
7 /dev/pts/5
2 /dev/pts/0
2 /dev/pts/0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Suse linux enterprise server 10

Table of Contents