|
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix |
|
lsof ("LiSt Open Files") is a tool to list open file handles on a server. Being able to filter these handles using the range of options and switches for lsof allows sysadmin to diagnose a number of problems. Among them
|
lsof +D /var/log # Show what files or filehandles are open in the specified directory.
As the name implies, this command examines the kernel's table of file descriptors associated with each process and displays the name of each file that is currently opened. In addition to giving the name of each file being currently referenced, lsof reveals the name of the executable currently being run by the process and the filenames of all mapped-in shared libraries. Besides this information, current versions of lsof can report open TCP/IP connections, as well as TCP and UDP sockets that are being listened to.
When lsof is run by a user, the program restricts its output to processes that are owned by that user. When lsof is run by the superuser, the program displays output for all processes on the system.
Syntax:
lsof -i [<protocol>][@<interface name>][:<port>]
You can specify some or all of the three parameters shown above. Any that are omitted are treated as wildcards. <port> can be either a single port or a range. Using lsof like this is similar to the behavior of netstat -a but also provides the process and owner information. For example:
lsof -iCOMMAND PID USER FD TYPE DEVICE SIZE NODE NAME dhcpcd 6061 root 4u IPv4 4510UDP *:bootpc sshd 7703 root 3u IPv6 6499TCP *:ssh (LISTEN) sshd 7892 root 3u IPv6 6757TCP 10.10.1.5:ssh->192.168.1.5:49901 (ESTABLISHED)
lsof -iTCPCOMMAND PID USER FD TYPE DEVICE SIZE NODE NAME sshd 7703 root 3u IPv6 6499TCP *:ssh (LISTEN) sshd 7892 root 3u IPv6 6757TCP 10.10.1.5:ssh->192.168.1.5:49901 (ESTABLISHED)
lsof -i :22COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME sshd 7703 root 3u IPv6 6499TCP *:ssh (LISTEN) sshd 7892 root 3u IPv6 6757TCP 10.10.1.5:ssh->192.168.1.5:49901 (ESTABLISHED)
lsof [email protected]sshd 7892 root 3u IPv6 6757TCP 10.10.1.5:ssh->192.168.1.5:49901 (ESTABLISHED)
lsof [email protected]:22sshd 7892 root 3u IPv6 6757TCP 10.10.1.5:ssh->192.168.1.5:49901 (ESTABLISHED)
lsof -i | grep LISTENiTunes 400 joeuser 16u IPv4 0x4575228 0t0 TCP *:daap(LISTEN)
lsof -i| grep ESTABLISHED firefox-b 169 joeuser 49u IPv4 0t0 TCP 1.2.3.3:1863->1.2.3.4:http(ESTABLISHED)
To trace a possible security breach in progress, or to verify that our application is connecting to the correct database server, lsof can show us a given user's current network connections.
# lsof -i -a -u fred COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME sshd 9696 fred 5u IPv4 0x3001 0t527 TCP gouda:22->edam:46528(ESTABLISHED) sshd 9696 fred 10u IPv4 0x300e 0t0 TCP localhost:6011(LISTEN) sshd 14710 fred 5u IPv4 0x3008 0t404 TCP gouda:22->edam:46590(ESTABLISHED) sshd 14710 fred 10u IPv4 0x307d 0t0 TCP localhost:6012(LISTEN) sshd 17013 fred 5u IPv4 0x300f 0t146 TCP gouda:22->edam:50019(ESTABLISHED) sshd 17013 fred 10u IPv4 0x30e0 0t0 TCP localhost:6010(LISTEN) ssh 25259 fred 4u IPv4 0x3000 0t157 TCP gouda:54435->colby:22(ESTABLISHED) sshd 25383 fred 5u IPv4 0x3000 0t126 TCP gouda:22->brie:34480(ESTABLISHED) ssh 25438 fred 4u IPv4 0x3000 0t91 TCP gouda:54448->smokey:22(ESTABLISHED)
A stray process can prevent a umount command from succeeding. Rather than use the -f flag and potentially cause corruptions, lsof can show you which processes need to be stopped first.
# lsof /mnt/scratchdisk COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME bash 7268 fred cwd VDIR 85,204 512 2 /mnt/scratchdisk/edam dcm 15375 george txt VREG 85,204 292352 202 /mnt/scratchdisk/bin/dcm dcm 15375 george cwd VDIR 85,204 512 5 /mnt/scratchdisk/bin/dcm
This shows that fred has a bash shell whose current working directory is on our mount point, and george has started a copy of dcm from another directory on the same file system.
lsof -c syslog-ngCOMMAND PID USER FD TYPE DEVICE SIZE NODE NAME syslog-ng 7547 root cwd DIR 3,3 4096 2 / syslog-ng 7547 root rtd DIR 3,3 4096 2 / syslog-ng 7547 root txt REG 3,3 113524 1064970 /usr/sbin/syslog-ng syslog-ng 7547 root mem REG 0,0 0 [heap] syslog-ng 7547 root mem REG 3,3 105435 850412 /lib/libpthread-2.4.so syslog-ng 7547 root mem REG 3,3 1197180 850396 /lib/libc-2.4.so syslog-ng 7547 root mem REG 3,3 59868 850413 /lib/libresolv-2.4.so syslog-ng 7547 root mem REG 3,3 72784 850404 /lib/libnsl-2.4.so syslog-ng 7547 root mem REG 3,3 32040 850414 /lib/librt-2.4.so syslog-ng 7547 root mem REG 3,3 126163 850385 /lib/ld-2.4.so -- snipped --
Syntax:
lsof -p <process id>[,<process id>[,<process id>[...]]]You can specify one or more process IDs (comma separated) to have lsof show all associated open file handles. This can be useful when trying to determine which libraries a particular running job is using. Doing this can also give you an indication as to how the process interacts with its log and configuration files.
Syntax:
lsof -u <username>[,<username>[,<username>[...]]]This command will show all open handles belonging to the given user(s).
lsof -u joeuser-- snipped -- Dock 155 joeuser txt REG 14,2 2798436 823208 /usr/lib/libicucore.A.dylib Dock 155 joeuser txt REG 14,2 1580212 823126 /usr/lib/libobjc.A.dylib Dock 155 joeuser txt REG 14,2 2934184 823498 /usr/lib/libstdc++.6.0.4.dylib Dock 155 joeuser txt REG 14,2 132008 823505 /usr/lib/libgcc_s.1.dylib Dock 155 joeuser txt REG 14,2 212160 823214 /usr/lib/libauto.dylib -- snipped --
Syntax:
lsof <file system or device>This option is a considerable help locating the processes that are preventing a umount command from completing, or tracking down an open file with no corresponding directory entry (see the examples below).
Some Other Useful Flags
- -b – Avoid using system calls that could cause blocking on the kernel
- -w – Suppress warning messages
- -P – Don't map network port numbers in /etc/services to their service names
- -a – Place this between two other flags to have lsof list only the handles that match both flags. By default, lsof will list handles that match either of the flags specified.
Find out exactly what is open via inetd right now.
# ps -ef | grep inetd root 2849 1 0 May 25 ? 6:43 /usr/sbin/inetd -s # lsof -i -a -p 2849 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME inetd 2849 root 11u IPv6 0x30006ec96d0 0t0 TCP *:ftp(LISTEN) inetd 2849 root 13u IPv4 0x30006ec9550 0t0 UDP *:name(Idle) inetd 2849 root 16u IPv4 0x30008f26ad8 0t0 TCP *:52783(LISTEN) inetd 2849 root 17u IPv4 0x30006ec9b50 0t0 UDP *:57504(Idle) inetd 2849 root 23u IPv6 0x30008f264d8 0t0 UDP *:servicetag(Idle) inetd 2849 root 24u IPv4 0x30008f26358 0t0 TCP *:servicetag(LISTEN)First we identify the process ID of inetd, then we have lsof list all IP handles (-i) that also (-a) are opened by that port (-p <process id>).
This shows us that fred has three incoming ssh connections and has opened two more outgoing ssh connections. Running lsof on one of the other servers, looking for the originating port (for example, port 46528 on edam), will allow us to continue following the trail from there.
It can often be highly frustrating to the administrator when a daemon fails to start, displaying the error port already in use. lsof can be used to track down what process is holding the port we want to use.
# lsof -i :7507 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME inetd 668 root 34u IPv4 0x303f0 0t0 TCP *: 7507 (LISTEN) answer 19757 nobody 0u IPv4 0x58028 0t132 TCP gouda:7507->edam:46111 (ESTABLISHED) answer 19757 nobody 1u IPv4 0x58028 0t132 TCP gouda:7507->edam:46111 (ESTABLISHED) answer 19757 nobody 2u IPv4 0x58028 0t132 TCP gouda:7507->edam:46111 (ESTABLISHED)
This shows that inetd is running a service called answer on that port and that something running on edam is connecting to it. Running lsof -i :46111 on edam will show which process this is.
If someone has deleted a file that a running process has open, the file system will not actually remove it until the last link to it has closed. In this case, the running process is the only thing left. If we can find the correct process, we can either shut it down (if we want the file gone) or save the contents of the file via the /proc file system (Solaris 8 onwards) if we need to salvage it.
gouda # df -k /opt/myapp/data Filesystem kbytes used avail capacity Mounted on /dev/md/dsk/d100 4129290 1458133 2629865 36% /opt/myapp gouda # lsof /opt/myapp | grep '/dev/md/dsk/d100' less 15043 fred 4r VREG 102,0 144 2050050 /opt/myapp (/dev/md/dsk/d100)
This shows us that the file is being held open by a copy of less (process ID 15043). If the goal is to get rid of the file, ending the less process will achieve this. If the goal is to salvage the contents of the file, though, it is still available to be copied out. The 4th column shows a (r)ead-only handle on file descriptor 4. This means the file is available for reading from /proc/15043/fd/4.
|
Switchboard | ||||
Latest | |||||
Past week | |||||
Past month |
May 23, 2021 | www.howtoforge.com
How to list all open files
To list all open files, run the lsof command without any arguments:
https://googleads.g.doubleclick.net/pagead/ads?us_privacy=1---&client=ca-pub-3043223216276099&output=html&h=15&slotname=2663697646&adk=3051840777&adf=2960717994&pi=t.ma~as.2663697646&w=728&lmt=1621746204&psa=0&channel=7741601259&url=https%3A%2F%2Fwww.howtoforge.com%2Flinux-lsof-command%2F&flash=0&wgl=1&uach=WyJXaW5kb3dzIiwiMTAuMCIsIng4NiIsIiIsIjkwLjAuODE4LjY2IixbXV0.&dt=1621746204547&bpp=3&bdt=217&idt=119&shv=r20210517&cbv=%2Fr20190131&ptt=9&saldr=aa&abxe=1&correlator=8372802808224&frm=20&pv=2&ga_vid=1566282676.1621746205&ga_sid=1621746205&ga_hid=170859195&ga_fc=0&u_tz=-240&u_his=1&u_java=0&u_h=1080&u_w=1920&u_ah=1040&u_aw=1920&u_cd=24&u_nplug=3&u_nmime=4&adx=310&ady=1488&biw=1903&bih=937&scr_x=0&scr_y=0&eid=182982100%2C182982300%2C31060956&oid=3&pvsid=3839444673908502&pem=871&wsm=1&ref=https%3A%2F%2Fwww.linuxtoday.com%2F&eae=0&fc=640&brdim=1920%2C0%2C1920%2C0%2C1920%2C0%2C1920%2C1040%2C1920%2C937&vis=1&rsz=%7C%7CeEbr%7C&abl=CS&pfx=0&fu=0&bc=31&ifi=1&uci=a!1&btvi=1&fsb=1&xpc=r4911PlF93&p=https%3A//www.howtoforge.com&dtd=130
lsofFor example, Here is the screengrab of a part of the output the above command produced on my system:
The first column represents the process while the last column contains the file name. For details on all the columns, head to the command's man page .
2. How to list files opened by processes belonging to a specific userThe tool also allows you to list files opened by processes belonging to a specific user. This feature can be accessed by using the -u command-line option.
https://dee55476188a72c2dd7471c6eb9d0c04.safeframe.googlesyndication.com/safeframe/1-0-38/html/container.html
lsof -u [user-name]
For example:
lsof -u administrator
3. How to list files based on their Internet addressThe tool lets you list files based on their Internet address. This can be done using the -i command-line option. For example, if you want, you can have IPv4 and IPv6 files displayed separately. For IPv4, run the following command:
https://dee55476188a72c2dd7471c6eb9d0c04.safeframe.googlesyndication.com/safeframe/1-0-38/html/container.html
lsof -i 4For example:
Similarly, for IPv6, run the following command:
lsof -i 6For example:
lsof -i 6 Advertisement
https://dee55476188a72c2dd7471c6eb9d0c04.safeframe.googlesyndication.com/safeframe/1-0-38/html/container.html
4. How to list all files by application nameThe -c command-line option allows you to get all files opened by program name.
$ lsof -c apacheYou do not have to use the full program name as all programs that start with the word 'apache' are shown. So in our case, it will list all processes of the 'apache2' application.
The -c option is basically just a shortcut for the two commands:
$ lsof | grep apache5. How to list files specific to a processThe tool also lets you display opened files based on process identification (PID) numbers. This can be done by using the -p command-line option.
lsof -p [PID]For example:
lsof -p 856Moving on, you can also exclude specific PIDs in the output by adding the ^ symbol before them. To exclude a specific PID, you can run the following command:
lsof -p [^PID]For example:
lsof -p ^1
As you can see in the above screenshot, the process with id 1 is excluded from the list.
6. How to list IDs of processes that have opened a particular fileThe tool allows you to list IDs of processes that have opened a particular file. This can be done by using the -t command line option.
$ lsof -t [file-name]For example:
$ lsof -t /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0.9.07. How to list all open files in a directoryIf you want, you can also make lsof search for all open instances of a directory (including all the files and directories it contains). This feature can be accessed using the +D command-line option.
$ lsof +D [directory-path]
For example:
$ lsof +D /usr/lib/locale
8. How to list all Internet and x.25 (HP-UX) network filesThis is possible by using the -i command-line option we described earlier. Just that you have to use it without any arguments.
$ lsof -i
9. Find out which program is using a portThe -i switch of the command allows you to find a process or application which listens to a specific port number. In the example below, I checked which program is using port 80.
$ lsof -i :80Instead of the port number, you can use the service name as listed in the /etc/services file. Example to check which app listens on the HTTPS (443) port:
$ lsof -i :httpsResult:
The above examples will check both TCP and UDP. If you like to check for TCP or UDP only, prepend the word 'tcp' or 'udp'. For example, which application is using port 25 TCP:
$ lsof -i tcp:25or which app uses UDP port 53:
$ lsof -i udp:5310. How to list open files based on port rangeThe utility also allows you to list open files based on a specific port or port range. For example, to display open files for port 1-1024, use the following command:
$ lsof -i :1-1024
11. How to list open files based on the type of connection (TCP or UDP)The tool allows you to list files based on the type of connection. For example, for UDP specific files, use the following command:
$ lsof -i udp
Similarly, you can make lsof display TCP-specific files.
12. How to make lsof list Parent PID of processesThere's also an option that forces lsof to list the Parent Process IDentification (PPID) number in the output. The option in question is -R .
$ lsof -RTo get PPID info for a specific PID, you can run the following command:
$ lsof -p [PID] -RFor example:
$ lsof -p 3 -R13. How to find network activity by userBy using a combination of the -i and -u command-line options, we can search for all network connections of a Linux user. This can be helpful if you inspect a system that might have been hacked. In this example, we check all network activity of the user www-data:
$ lsof -a -i -u www-data14. List all memory-mapped filesThis command lists all memory-mapped files on Linux.
$ lsof -d mem15. List all NFS filesThe -N option shows you a list of all NFS (Network File System) files.
$lsof -NConclusionAlthough lsof offers a plethora of options, the ones we've discussed here should be enough to get you started. Once you're done practicing with these, head to the tool's man page to learn more about it. Oh, and in case you have any doubts and queries, drop in a comment below.
About Himanshu Arora
Himanshu Arora has been working on Linux since 2007. He carries professional experience in system level programming, networking protocols, and command line. In addition to HowtoForge, Himanshu's work has also been featured in some of world's other leading publications including Computerworld, IBM DeveloperWorks, and Linux Journal.
By: ShabbyCat at: 2020-05-31 23:47:44 ReplyGreat article! Another useful one is "lsof -i tcp:PORT_NUMBER" to list processes happening on a specific port, useful for node.js when you need to kill a process.
Ex: lsof -i tcp:3000
then say you want to kill the process 5393 (PID) running on port 3000, you would run "kill -9 5393"
Jan 01, 2011 | unix.stackexchange.com
ripper234 , 2011-04-13 08:51:26
I tried torm -rf
a folder, and got "device or resource busy".In Windows, I would have used LockHunter to resolve this. What's the linux equivalent? (Please give as answer a simple "unlock this" method, and not complete articles like this one . Although they're useful, I'm currently interested in just ASimpleMethodThatWorks™)
camh , 2011-04-13 09:22:46
The tool you want islsof
, which stands for list open files .It has a lot of options, so check the man page, but if you want to see all open files under a directory:
lsof +D /pathThat will recurse through the filesystem under
/path
, so beware doing it on large directory trees.Once you know which processes have files open, you can exit those apps, or kill them with the
kill(1)
command.kip2 , 2014-04-03 01:24:22
sometimes it's the result of mounting issues, so I'd unmount the filesystem or directory you're trying to remove:umount /path
BillThor ,
I usefuser
for this kind of thing. It will list which process is using a file or files within a mount.user73011 ,
Here is the solution:
- Go into the directory and type
ls -a
- You will find a
.xyz
filevi .xyz
and look into what is the content of the fileps -ef | grep username
- You will see the .xyz content in the 8th column (last row)
kill -9 job_ids
- where job_ids is the value of the 2nd column of corresponding error caused content in the 8th column- Now try to delete the folder or file.
Choylton B. Higginbottom ,
I had this same issue, built a one-liner starting with @camh recommendation:lsof +D ./ | awk '{print $2}' | tail -n +2 | xargs kill -9The
awk
command grabs the PIDS. Thetail
command gets rid of the pesky first entry: "PID". I used-9
on kill, others might have safer options.user5359531 ,
I experience this frequently on servers that have NFS network file systems. I am assuming it has something to do with the filesystem, since the files are typically named like.nfs000000123089abcxyz
.My typical solution is to rename or move the parent directory of the file, then come back later in a day or two and the file will have been removed automatically, at which point I am free to delete the directory.
This typically happens in directories where I am installing or compiling software libraries.
gloriphobia , 2017-03-23 12:56:22
I had this problem when an automated test created a ramdisk. The commands suggested in the other answers,lsof
andfuser
, were of no help. After the tests I tried to unmount it and then delete the folder. I was really confused for ages because I couldn't get rid of it -- I kept getting "Device or resource busy" !By accident I found out how to get rid of a ramdisk. I had to unmount it the same number of times that I had run the
mount
command, i.e.sudo umount path
Due to the fact that it was created using automated testing, it got mounted many times, hence why I couldn't get rid of it by simply unmounting it once after the tests. So, after I manually unmounted it lots of times it finally became a regular folder again and I could delete it.
Hopefully this can help someone else who comes across this problem!
bil , 2018-04-04 14:10:20
Riffing off of Prabhat's question above, I had this issue in macos high sierra when I stranded an encfs process, rebooting solved it, but thisps -ef | grep name-of-busy-dirShowed me the process and the PID (column two).
sudo kill -15 pid-herefixed it.
Prabhat Kumar Singh , 2017-08-01 08:07:36
If you have the server accessible, TryDeleting that dir from the server
Or, do umount and mount again, try
umount -l
: lazy umount if facing any issue on normal umount.I too had this problem where
lsof +D path
: gives no output
ps -ef
: gives no relevant information
January 27, 2010 | www.itworld.com
You have probably used lsof from time to time, probably when tracking down some sort of problem. But maybe you haven't tried all of its permutations or looked at it just to get a deeper understanding of how some particular process works. Let's look at one particular lsof command that can provide a lot of insight into a single process.
In this first example, we're going to look at the ypbind process with the command "lsof -c ypbind". The "c" specifies that we want to look at processes whose names start with "ypbind".
We see right away that ypbind is running as PID 198, making it likely it hasn't been restarted since the system was booted. We can also scan through the lines of output and see that it's using ports 32779 (UDP) and 32772 (TCP), both running IPv4.
bash-2.03# lsof -n -c ypbind COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ypbind 198 root cwd VDIR 136,0 2048 2 / ypbind 198 root txt VREG 136,0 36256 115560 /usr/lib/netsvc/yp/ypbind ypbind 198 root txt VREG 136,0 1158072 269602 /usr/lib/libc.so.1 ypbind 198 root txt VREG 136,0 13184 269407 / (/dev/dsk/c0t2d0s0) ypbind 198 root txt VREG 136,0 919956 269353 /usr/lib/libnsl.so.1 ypbind 198 root txt VREG 136,0 17096 473904 /usr/platform/sun4u/lib/libc_psr.so.1 ypbind 198 root txt VREG 136,0 24968 269369 /usr/lib/libmp.so.2 ypbind 198 root txt VREG 136,0 5008 269399 /usr/lib/libdl.so.1 ypbind 198 root txt VREG 136,0 266140 269361 /usr/lib/ld.so.1 ypbind 198 root 0r VCHR 13,2 0t0 864205 /devices/pseudo/mm@0:null ypbind 198 root 1w VCHR 13,2 0t0 864205 /devices/pseudo/mm@0:null ypbind 198 root 2w VCHR 13,2 0t0 864205 /devices/pseudo/mm@0:null ypbind 198 root 3ww VREG 136,0 4 966677 /var/yp/binding/ypbind.pid ypbind 198 root 4u IPv4 0x3000015a4b0 0t0 UDP *:32779 (Idle) ypbind 198 root 5ww VREG 136,0 15 966840 /var/yp/binding/xprt.udp.3 ypbind 198 root 6ww VREG 136,0 15 966841 /var/yp/binding/xprt.udp.2 ypbind 198 root 7ww VREG 136,0 15 966842 /var/yp/binding/xprt.udp.1 ypbind 198 root 8u IPv4 0x3000015a030 0t0 TCP *:32772 (LISTEN) ypbind 198 root 9ww VREG 136,0 14 966848 / (/dev/dsk/c0t2d0s0) ypbind 198 root 10ww VREG 136,0 14 966849 / (/dev/dsk/c0t2d0s0) ypbind 198 root 11ww VREG 136,0 14 966850 /var/yp/binding/xprt.tcp.1 ypbind 198 root 12u VCHR 105,19 0t0 864213 /devices/pseudo/tl@0:ticots->timod->tl ypbind 198 root 13ww VREG 136,0 14 966851 / (/dev/dsk/c0t2d0s0) ypbind 198 root 14ww VREG 136,0 14 967065 / (/dev/dsk/c0t2d0s0) ypbind 198 root 15ww VREG 136,0 14 967066 / (/dev/dsk/c0t2d0s0) ypbind 198 root 16u VCHR 105,20 0t0 864213 /devices/pseudo/tl@0:ticots->timod->tl ypbind 198 root 17ww VREG 136,0 14 967067 /var/yp/binding/xprt.ticotsord.3 ypbind 198 root 18ww VREG 136,0 14 967077 /var/yp/binding/xprt.ticotsord.2 ypbind 198 root 19ww VREG 136,0 14 967079 /var/yp/binding/xprt.ticotsord.1 ypbind 198 root 20u VCHR 105,21 0t0 864213 /devices/pseudo/tl@0:ticots->timod->tl ypbind 198 root 21ww VREG 136,0 14 967080 /var/yp/binding/xprt.ticots.3 ypbind 198 root 22ww VREG 136,0 140 44801 / -- cache_bindingThe FD and TYPE columns in this output require a little explanation. FD, as you likely suspect, stands for "file descriptor". But it contains values that we don't normally relate to file descriptors -- like "cwd" and "txt". It also shows "r", "u" and "w" characters after the numeric values.
The "cwd" descriptor displays the process' current working directory. The "txt" indicates that the associated files are program code and libraries (code and data). The 0-22 values represent what we normally think of as file descriptors. The extra characters show that the process has read (r), write (w) or read/write (u) access to each.
VREG (REG if you're not using Solaris) and VDIR (DIR) values in the TYPE column represent regular files and directories. CHR and BLK stand for character and block devices. You might also see UNIX, FIFO and IPV4 for Unix domain sockets, first-in-first-out queues and sockets.
The DEVICE and SIZE/OFF columns refer to the open files -- the disk, file size (or current position in the file) and inode (yes, / is inode 2). Then, of course, we have the file or device name under NAME.
To illustrate how lsof works, let's watch someone editing the /etc/passwd file. So let's try looking for vi.
bash-2.03# lsof -c vi COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME vi 12357 root cwd VDIR 136,0 2048 2 / vi 12357 root txt VREG 136,0 226656 896951 /usr/bin/ex vi 12357 root txt VREG 136,0 17096 473904 /usr/platform/sun4u/lib/libc_psr.so.1 vi 12357 root txt VREG 136,0 5008 269399 /usr/lib/libdl.so.1 vi 12357 root txt VREG 136,0 1158072 269602 /usr/lib/libc.so.1 vi 12357 root txt VREG 136,0 42184 269355 /usr/lib/libgen.so.1 vi 12357 root txt VREG 136,0 16020 269344 /usr/lib/libcrypt_i.so.1 vi 12357 root txt VREG 136,0 466552 269345 /usr/lib/libcurses.so.1 vi 12357 root txt VREG 136,0 14556 269365 /usr/lib/libmapmalloc.so.1 vi 12357 root txt VREG 136,0 266140 269361 /usr/lib/ld.so.1 vi 12357 root 0u VCHR 24,8 0t1731 864291 /devices/pseudo/pts@0:8->ttcompat->ldterm->ptem->pts vi 12357 root 1u VCHR 24,8 0t1731 864291 /devices/pseudo/pts@0:8->ttcompat->ldterm->ptem->pts vi 12357 root 2u VCHR 24,8 0t1731 864291 /devices/pseudo/pts@0:8->ttcompat->ldterm->ptem->pts vi 12357 root 3u VCHR 13,12 0t0 864206 /devices/pseudo/mm@0:zero vi 12357 root 4u VREG 136,0 24576 736000 /var/tmp/ExDOaOiyOK, so we have some output, but no mention of vi under NAME. Why is this?
With just a bit of checking, we confirm that vi and ex are the same executable (as shown by the following ls commands) and we do see ex listed in the second row.
# ls -li /usr/bin/ex 384 -r-xr-xr-x 5 root bin 227828 Jun 19 2002 /usr/bin/ex # ls -li /usr/bin/vi 384 -r-xr-xr-x 5 root bin 227828 Jun 19 2002 /usr/bin/viWe get a listing of the various libraries that vi is using -- seven of them in addition to ld.so.
We also see no mention of /etc/passwd in the files list. However, we do see that a temporary file has been opened in /var/tmp. Ah, yes, this is the directory that vi uses to store files that it is working on. We can check the /var/tmp/directory and verify the file name and size.
bash-2.03# ls -l /var/tmp/Ex* total 26814 -rw------- 1 root other 24576 Jan 26 16:49 ExDOaOiyAnd if, out of some dweebish curiosity, we want to verify that this "Ex" file is indeed the /etc/passwd file that is being edited, we can steal a look at it. Just be prepared for it to look a little bit different in the form of a vi temporary file.
bash-2.03# more /var/tmp/ExDOaOiy K_c{/etc/passwd ˙˙ root:x:0:1:Super-User:/:/bin/sh:/bin/bashdaemon:x:1:1::/:bin:x:2:2::/usr/bin:sys ...Yes, that's certainly the /etc/passwd file.
The lsof command can provide an interesting view of how a particular process works as well as what it is working on and with.
JohnHilgart (1/28/10):That's very interesting. I was too lazy to find those things out for myself by reading the man pages, which are a lot more inscrutable, but this presentation really helps gain an understanding of the importance and utility of lsof.Experimenting a little, I see lsof helps answer the problem when you need this question answered: what process is listening on TCP port XYZ?
lsof -P|grep TCP|grep XYZ
Yeah, I'm sure there's a proper, lsof way to specify swicthes to limit its output to find this info, but I don't have time to experiment further.
LiSt Open Files is a useful and powerful tool that will show you opened files. In Unix everything is a file: pipes are files, IP sockets are files, unix sockets are files, directories are files, devices are files, inodes are files...
Useful Examples
So in this tangle of files lsof listst files opened by processes running on your system.
When lsof is called without parameters, it will show all the files opened by any processes.
lsof | nl
Let us know who is using the apache executable file, /etc/passwd, what files are opened on device /dev/hda6 or who's accessing /dev/cdrom:
lsof `which apache2`
lsof /etc/passwd
lsof /dev/hda6
lsof /dev/cdromNow show us what process IDs are using the apache binary, and only the PID:
lsof -t `which apache2`
Show us what files are opened by processes whose names starts by "k" (klogd, kswapd...) and bash. Show us what files are opened by init:
lsof -c k
lsof -c bash
lsof -c initShow us what files are opened by processes whose names starts by "courier", but exclude those whose owner is the user "zahn":
lsof -c courier -u ^zahn
Show us the processes opened by user apache and user zahn:
lsof -u apache,zahn
Show us what files are using the process whose PID is 30297:
lsof +p 30297
Search for all opened instances of directory /tmp and all the files and directories it contains:
lsof +D /tmp
List all opened internet sockets and sockets related to port 80:
lsof -i
lsof -i :80List all opened Internet and UNIX domain files:
lsof -i -U
Show us what process(es) has an UDP connection opened to or from the host www.akadia.com at port 123 (ntp):
lsof [email protected]:123lsof provides many more options and could be an unvaluable foresinc tool if your system get compromised or as daily basis check tool.
Google matched content |
lsof - Wikipedia, the free encyclopedia
A Unix Utility You Should Know About lsof - good coders code, great reuse
Leveraging lsof to Troubleshoot Network, Filesystem, Native Library or Device Problems
Finding open files with lsof ibm.com
LinuxPlanet - Tips - Recover Deleted Linux Files With lsof
Use lsof to find 'file in use' culprits - Mac OS X Hints
Agile Testing- NFS troubleshooting with iostat and lsof
lsof, sockets and trojans - ServerWatch.com
Cool Solutions- How to use the lsof command
HP-UX
AIX
-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@xxxxxxxxxxxxx]
On Behalf Of
Jeff Barratt-McCartney
Sent: Wednesday, August 09, 2006 9:47 AM
To: aix-l@xxxxxxxxxxxxx
Subject: Re: LSOF with AIX 5.3 ML04
i'm using 4.76 under 5.3.04 works fine
-----Original Message-----
From: IBM AIX Discussion List on behalf of Green, Simon
Sent: Wed 8/9/2006 9:30 AM
To: aix-l@xxxxxxxxxxxxx
Subject: LSOF with AIX 5.3 ML04
The version of lsof we have on most of our servers is rather old and
doesn't work with AIX 5.2 or 5.3.
Recently, I installed a newer version, downloaded from the IBM AIX
Toolbox page, on our 5.2 servers. This works fine.
I just tried to do the same for our 5.3 servers - using the 5.3 binary
of course! - but when I try to run it, lsof core dumps. That's
lsof-4.61-4.
We're running AIX 5.3 ML04. We don't have any other maintenance levels
in use.
Has anybody else experienced this problem? Any way around it? LSOF
isn't essential, but it's handy to have available.
Thanks,
--
Simon Green
Altria ITSC Europe s.a.r.l
Solaris
When lsof is called without parameters, it will show all the files opened by any processes.
lsof | nl
Let us know who is using the apache executable file, /etc/passwd, what files are opened on device /dev/hda6 or who's accessing /dev/cdrom:
lsof `which apache2`
lsof /etc/passwd
lsof /dev/hda6
lsof /dev/cdromNow show us what process IDs are using the apache binary, and only the PID:
lsof -t `which apache2`
Show us what files are opened by processes whose names starts by "k" (klogd, kswapd...) and bash. Show us what files are opened by init:
lsof -c k
lsof -c bash
lsof -c initShow us what files are opened by processes whose names starts by "courier", but exclude those whose owner is the user "zahn":
lsof -c courier -u ^zahn
Show us the processes opened by user apache and user zahn:
lsof -u apache,zahn
Show us what files are using the process whose PID is 30297:
lsof +p 30297
Search for all opened instances of directory /tmp and all the files and directories it contains:
lsof +D /tmp
List all opened internet sockets and sockets related to port 80:
lsof -i
lsof -i :80List all opened Internet and UNIX domain files:
lsof -i -U
Show us what process(es) has an UDP connection opened to or from the host www.akadia.com at port 123 (ntp):
lsof [email protected]:123lsof provides many more options and could be an unvaluable foresinc tool if your system get compromised or as daily basis check tool.
lsof -i -- Show all connections lsof -iTCP -- Show only TCP connections (works the same for UDP) lsof -i :22 -- -i :port shows all networking related to a given port lsof [email protected] -- To show connections to a specific host, use @host lsof [email protected]:22 -- Show connections based on the host and the port using @host:port lsof -i| grep LISTEN -- Grepping for "LISTEN" shows what ports your system is waiting for connections on lsof -i| grep ESTABLISHED -- Grepping for "ESTABLISHED" shows current active connections lsof -u ecable -- Show what a given user has open using -u lsof -c syslog-ng -- See what files and network connections a command is using with -c lsof /var/log/messages -o a file shows what's interacting with that file lsof -p 10075 -- The -p switch lets you see what a given process ID has open, which is good for learning more about unknown processes lsof -t -c Mail -- The -t option returns just a PID lsof -a -u ecable -i @1.1.1.1 -- Using-a allows you to combine search terms, so the query below says, "show me everything running as joeuser connected to 1.1.1.1" kill -HUP `lsof -t -c sshd` -- Using the -t and -c options together you can HUP processes kill -9 `lsof -t -u joeuser` -- You can also use the -t with -u to kill everything a user has open lsof +L1 -- lsof +L1 shows you all open files that have a link count less than 1, often indicative of a cracker trying to hide something
lsof [ -?abChlnNOPRstUvVX ] [ -A A ] [ -c c ] [ +|-d d ] [ +|-D D ] [ +|-f [cfgGn] ] [ -F [f] ] [ -g [s] ] [ -i [i] ] [ -k k ] [ +|-L [l] ] [ -m m ] [ +|-M ] [ -o [o] ] [ -p s ] [ +|-r [t] ] [ -S [t] ] [ -T [t] ] [ -u s ] [ +|-w ] [ -- ] [names]
Lsof revision 4.63 lists information about files opened by processes for the following UNIX dialects:AIX 4.3.[23], 5L, and 5.1 Apple Darwin 1.[23] and 1.4 for Power Macintosh systems BSDI BSD/OS 4.1 for Intel-based systems DEC OSF/1, Digital UNIX, Tru64 UNIX 4.0, and 5.[01] FreeBSD 4.[2345] and 5.0 for Intel-based systems HP-UX 11.00 and 11.11 Linux 2.1.72 and above for Intel-based systems NetBSD 1.5 for Alpha, Intel, and SPARC-based systems NEXTSTEP 3.[13] for NEXTSTEP architectures OpenBSD 2.[89] and 3.0 for Intel-based systems OPENSTEP 4.x Caldera OpenUNIX 8 SCO OpenServer Release 5.0.[46] for Intel-based systems SCO UnixWare 7.1.1 for Intel-based systems Solaris 2.6, 7, 8, and 9 BETA-Refresh
(See the DISTRIBUTION section of this manual page for information on how to obtain the latest lsof revision.)
An open file may be a regular file, a directory, a block special file, a character special file, an executing text reference, a library, a stream or a network file (Internet socket, NFS file or UNIX domain socket.) A specific file or all the files in a file system may be selected by path.
Instead of a formatted display, lsof will produce output that can be parsed by other programs. See the -F, option description, and the OUTPUT FOR OTHER PROGRAMS section for more information.
In addition to producing a single output list, lsof will run in repeat mode. In repeat mode it will produce output, delay, then repeat the output operation until stopped with an interrupt or quit signal. See the +|-r [t] option description for more information.
If any list request option is specified, other list requests must be specifically requested - e.g., if -U is specified for the listing of UNIX socket files, NFS files won't be listed unless -N is also specified; or if a user list is specified with the -u option, UNIX domain socket files, belonging to users not in the list, won't be listed unless the -U option is also specified.
Normally list options that are specifically stated are ORed - i.e., specifying the -i option without an address and the -ufoo option produces a listing of all network files OR files belonging to processes owned by user ``foo''. One exception is the `^' (negated) login name or user ID (UID) specified with the -u option. Since it is an exclusion, it is applied without ORing or ANDing and takes effect before any other selection criteria are applied.
The -a option may be used to AND the selections. For example, specifying -a, -U, and -ufoo produces a listing of only UNIX socket files that belong to processes owned by user ``foo''.
Caution: the -a option causes all list selection options to be ANDed; it can't be used to cause ANDing of selected pairs of selection options by placing it between them, even though its placement there is acceptable. Wherever -a is placed, it causes the ANDing of all selection options.
Items of the same selection set - command names, file descriptors, network addresses, process identifiers, user identifiers - are joined in a single ORed set and applied before the result participates in ANDing. Thus, for example, specifying -i@aaa.bbb, -i@ccc.ddd, -a, and -ufff,ggg will select the listing of files that belong to either login ``fff'' OR ``ggg'' AND have network connections to either host aaa.bbb OR ccc.ddd.
Options may be grouped together following a single prefix -- e.g., the option set ``-a -b -C'' may be stated as -abC. However, since values are optional following +|-f, -F, -g, -i, +|-L, -o, +|-r, -S, and -T, when you have no values for them be careful that the following character isn't ambiguous. For example, -Fn might represent the -F and -n options, or it might represent the n field identifier character following the -F option. When ambiguity is possible, start a new option with a `-' character - e.g., ``-F -n''. If the next option is a file name, follow the possibly ambiguous option with ``--'' - e.g., ``-F -- name''.
Either the `+' or the `-' prefix may be applied to a group of options. Options that don't take on separate meanings for each prefix - e.g., -i - may be grouped under either prefix. Thus, for example, ``+M -i'' may be stated as ``+Mi'' and the group means the same as the separate options. Be careful of prefix grouping when one or more options in the group does take on separate meanings under different prefixes - e.g., +|-M; ``-iM'' is not the same request as ``-i +M''. When in doubt, use separate options with appropriate prefixes.
b the regular expression is a basic one.
i ignore the case of letters.
x the regular expression is an extended one
(default).
? - report device cache file paths b - build the device cache file i - ignore the device cache file r - read the device cache file u - read and update the device cache file
$ lsof +f -- /file/system/name
c file structure use count f file structure address g file flag abbreviations G file flags in hexadecimal n file structure node address
46 specifies the IP version, IPv4 or IPv6
that applies to the following address.
'6' may be be specified only if the UNIX
dialect supports IPv6. If neither '4' nor
'6' is specified, the following address
applies to all IP versions.
protocol is a protocol name - TCP or UDP.
hostname is an Internet host name. Unless a
specific IP version is specified, open
network files associated with host names
of all versions will be selected.
hostaddr is a numeric Internet IPv4 address in
dot form; or an IPv6 numeric address in
colon form, enclosed in brackets, if the
UNIX dialect supports IPv6. When an IP
version is selected, only its numeric
addresses may be specified.
service is an /etc/services name - e.g., smtp - or a list of them.
port is a port number, or a list of them.
-i6 - IPv6 only
TCP:25 - TCP and port 25
@1.2.3.4 - Internet IPv4 host address 1.2.3.4
@[3ffe:1ebc::1]:1234 - Internet IPv6 host address 3ffe:1ebc::1, port 1234
UDP:who - UDP who service port
[email protected]:513 - TCP, port 513 and host name vic.cc
tcp@foo:1-10,smtp,99 - TCP, ports 1 through 10, service name smtp, port 99, host name foo
tcp@bar:smtp-nameserver - TCP, ports smtp through nameserver, host bar
:time - either TCP or UDP time service port
-o -o 10 or -oo10
<TCP or TPI state name> QR=<read queue length> QS=<send queue length> WR=<window read length> (not all dialects) WW=<window write length> (not all dialects)
q selects queue length reporting. s selects state reporting. w selects window size reporting (not all dialects).
AIX 4.1.4 (AFS 3.4a) HP-UX 9.0.5 (AFS 3.4a) Linux 1.2.13 (AFS 3.3) Solaris 2.[56] (AFS 3.4a)
It may recognize AFS files on other versions of these dialects, but has not been tested there. Depending on how AFS is implemented, lsof may recognize AFS files in other dialects, or may have difficulties recognizing AFS files in the supported dialects.
Lsof may have trouble identifying all aspects of AFS files in supported dialects when AFS kernel support is implemented via dynamic modules whose addresses do not appear in the kernel's variable name list. In that case, lsof may have to guess at the identity of AFS files, and might not be able to obtain volume information from the kernel that is needed for calculating AFS volume node numbers. When lsof can't compute volume node numbers, it reports blank in the NODE column.
The -A A option is available in some dialect implementations of lsof for specifying the name list file where dynamic module kernel addresses may be found. When this option is available, it will be listed in the lsof help output, presented in response to the -h or -?
See the lsof FAQ (The FAQ section gives its location.) for more information about dynamic modules, their symbols, and how they affect lsof options.
Because AFS path lookups don't seem to participate in the kernel's name cache operations, lsof can't identify path name components for AFS files.
Restricting the listing of all open files is controlled by the compile-time HASSECURITY option. When HASSECURITY is defined, lsof will allow only the root user to list all open files. The non-root user may list only open files of processes with the same user IDentification number as the real user ID number of the lsof process (the one that its user logged on with). When HASSECURITY is not defined, anyone may list all open files.
Help output, presented in response to the -h or -? option, gives the HASSECURITY definition status.
See the Security section of the 0README file of the lsof distribution for information on building lsof with the HASSECURITY option enabled.
Creation and use of a user-readable and user-writable device cache file is controlled by the compile-time HASDCACHE option. See the DEVICE CACHE FILE section and the sections that follow it for details on how its path is formed. For security considerations it is important to note that in the default lsof distribution, if the real user ID under which lsof is executed is root, the device cache file will be written in root's home directory - e.g., / or /root. When HASDCACHE is not defined, lsof does not write or attempt to read a device cache file.
When HASDCACHE is defined, the lsof help output, presented in response to the -h, -D?, or -? options, will provide device cache file handling information. When HASDCACHE is not defined, the -h or -? output will have no -D option description.
Before you decide to disable the device cache file feature - enabling it improves the performance of lsof by reducing the startup overhead of examining all the nodes in /dev (or /devices) - read the discussion of it in the 00DCACHE file of the lsof distribution and the lsof FAQ (The FAQ section gives its location.)
WHEN IN DOUBT, YOU CAN TEMPORARILY DISABLE THE USE OF THE DEVICE CACHE FILE WITH THE -Di OPTION.
When lsof user declares alternate kernel name list or memory files with the -k and -m options, lsof checks the user's authority to read them with access(2). This is intended to prevent whatever special power lsof's modes might confer on it from letting it read files not normally accessible via the authority of the real user ID.
Lsof only outputs printable (declared so by isprint(3)) ASCII characters. Non-printable characters are printed in one of three forms: the C ``\[bfrnt]'' form; the control character `^' form (e.g., ``^@''); or hexadecimal leading ``\x'' form (e.g., ``\xab''). Space is non-printable in the COMMAND column (``\x20'') and printable elsewhere.
Lsof dynamically sizes the output columns each time it runs, guaranteeing that each column is a minimum size. It also guarantees that each column is separated from its predecessor by at least one space.
cwd current working directory;
Lnn library references (AIX);
jld jail directory (FreeBSD);
ltx shared library text (code and data);
Mxx hex memory-mapped type number xx.
m86 DOS Merge mapped file;
mem memory-mapped file;
mmap memory-mapped device;
pd parent directory;
rtd root directory;
txt program text (code and data);
v86 VP/ix mapped file;
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.
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.
AIO asynchronous I/O (e.g., FAIO) AP append ASYN asynchronous I/O (e.g., FASYNC) BAS block, test, and set in use BKIU block if in use BL use block offsets BSK block seek CA copy avoid CLON clone CLRD CL read CR create DF defer DFI defer IND DFLU data flush DIR direct DLY delay DOCL do clone DSYN data-only integrity EX open for exec EXCL exclusive open FSYN synchronous writes GCDF defer during unp_gc() (AIX) GCMK mark during unp_gc() (AIX) GTTY accessed via /dev/tty HUP HUP in progress KERN kernel KIOC kernel-issued ioctl LCK has lock LG large file MBLK stream message block MK mark MNT mount MSYN multiplex synchronization NB non-blocking I/O NBDR no BDRM check NBIO SYSV non-blocking I/O NBF n-buffering in effect NC no cache ND no delay NDSY no data synchronization NET network NMFS NM file system NOTO disable background stop NSH no share NTTY no controlling TTY OLRM OLR mirror PAIO POSIX asynchronous I/O PP POSIX pipe R read RAIO Reliant UNIX RAIO request RC file and record locking cache REV revoked RSH shared read RSYN read synchronization SL shared lock SOCK socket SQSH Sequent shared set on open SQSV Sequent SVM set on open SQR Sequent set repair on open SQS1 Sequent full shared open SQS2 Sequent partial shared open STPI stop I/O SWR synchronous read SYN file integrity while writing TCPM avoid TCP collision TR truncate W write WKUP parallel I/O synchronization WTG parallel I/O synchronization VH vhangup pending VTXT virtual text XL exclusive lock
ALLC allocated BR the file has been read BHUP activity stopped by SIGHUP BW the file has been written CLSG closing CX close-on-exec (see fcntl(F_SETFD)) MP memory-mapped LCK lock was applied RSVW reserved wait SHMT UF_FSHMAT set (AIX) USE in use (multi-threaded)
For dialects that support a ``namefs'' file system, allowing one file to be attached to another with fattach(3C), lsof will add ``(FA:<address1><direction><address2>)'' to the NAME column. <address1> and <address2> are hexadecimal vnode addresses. <direction> will be ``<-'' if <address2> has been fattach'ed to this vnode whose address is <address1>; and ``->'' if <address1>, the vnode address of this vnode, has been fattach'ed to <address2>. <address1> may be omitted if it already appears in the DEVICE column.
Moreover, when a process holds several byte level locks on a file, lsof only reports the status of the first lock it encounters. If it is a byte level lock, then the lock character will be reported in lower case - i.e., `r', `w', or `x' - rather than the upper case equivalent reported for a full file lock.
Generally lsof can only report on locks held by local processes on local files. When a local process sets a lock on a remotely mounted (e.g., NFS) file, the remote server host usually records the lock state. One exception is Solaris - at some patch levels of 2.3, and in all versions above 2.4, the Solaris kernel records information on remote locks in local structures.
Lsof has trouble reporting locks for some UNIX dialects. Consult the BUGS section of this manual page or the lsof FAQ (The FAQ section gives its location.) for more information.
Each unit of information is output in a field that is identified with a leading character and terminated by a NL (012) (or a NUL (000) if the 0 (zero) field identifier character is specified.) The data of the field follows immediately after the field identification character and extends to the field terminator.
It is possible to think of field output as process and file sets. A process set begins with a field whose identifier is `p' (for process IDentifier (PID)). It extends to the beginning of the next PID field or the beginning of the first file set of the process, whichever comes first. Included in the process set are fields that identify the command, the process group IDentification (PGID) number, and the user ID (UID) number or login name.
A file set begins with a field whose identifier is `f' (for file descriptor). It is followed by lines that describe the file's access mode, lock state, type, device, size, offset, inode, protocol, name and stream module names. It extends to the beginning of the next file or process set, whichever comes first.
When the NUL (000) field terminator has been selected with the 0 (zero) field identifier character, lsof ends each process and file set with a NL (012) character.
Lsof always produces one field, the PID (`p') field. All other fields may be declared optionally in the field identifier character list that follows the -F option. When a field selection character identifies an item lsof does not normally list - e.g., PPID, selected with -R - specification of the field character - e.g., ``-FR'' - also selects the listing of the item.
It is entirely possible to select a set of fields that cannot easily be parsed - e.g., if the field descriptor field is not selected, it may be difficult to identify file sets. To help you avoid this difficulty, lsof supports the -F option; it selects the output of all fields with NL terminators (the -F0 option pair selects the output of all fields with NUL terminators). For compatibility reasons neither -F nor -F0 select the raw device field.
These are the fields that lsof will produce. The single character listed first is the field identifier.
a file access mode c process command name (all characters from proc or user structure) C file structure share count d file's device character code D file's major/minor device number (0x<hexadecimal>) f file descriptor F file structure address (0x<hexadecimal>) G file flaGs (0x<hexadecimal>; names if +fg follows) i file's inode number l file's lock status L process login name m marker between repeated output n file name, comment, Internet address N node identifier (ox<hexadecimal> o file's offset (decimal) p process ID (always selected) g process group ID P protocol name r raw device number (0x<hexadecimal>) R parent process ID s file's size (decimal) S file's stream identification t file's type T TCP/TPI information, identified by prefixes (the `=' is part of the prefix): ST=<state> QR=<read queue size> QS=<write queue size> WR=<window read size> (not all dialects) WW=<window write size> (not all dialects) (TPI state information and window sizes aren't reported for all supported UNIX dialects. The -h or -? help output for the -T option will show whether window size reporting can be requested.) u process user ID 0 use NUL field terminator character in place of NL 1-9 dialect-specific field identifiers (The output of -F? identifies the information to be found in dialect-specific fields.)
You can get on-line help information on these characters and their descriptions by specifying the -F? option pair. (Escape the `?' character as your shell requires.) Additional information on field content can be found in the OUTPUT section.
As an example, ``-F pcfn'' will select the process ID (`p'), command name (`c'), file descriptor (`f') and file name (`n') fields with an NL field terminator character; ``-F pcfn0'' selects the same output with a NUL (000) field terminator character.
Lsof doesn't produce all fields for every process or file set, only those that are available. Some fields are mutually exclusive: file device characters and file major/minor device numbers; file inode number and protocol name; file name and stream identification; file size and offset. One or the other member of these mutually exclusive sets will appear in field output, but not both.
Normally lsof ends each field with a NL (012) character. The 0 (zero) field identifier character may be specified to change the field terminator character to a NUL (000). A NUL terminator may be easier to process with xargs (1), for example, or with programs whose quoting mechanisms may not easily cope with the range of characters in the field output. When the NUL field terminator is in use, lsof ends each process and file set with a NL (012).
Three aids to producing programs that can process lsof field output are included in the lsof distribution. The first is a C header file, lsof_fields.h, that contains symbols for the field identification characters, indexes for storing them in a table, and explanation strings that may be compiled into programs. Lsof uses this header file.
The second aid is a set of sample scripts that process field output, written in awk, Perl 4, and Perl 5. They're located in the scripts subdirectory of the lsof distribution.
The third aid is the C library used for the lsof test suite. The test suite is written in C and uses field output to validate the correct operation of lsof. The library can be found in the tests/LTlib.c file of the lsof distribution. The library uses the first aid, the lsof_fields.h header file.
Lsof attempts to break these blocks with timers and child processes, but the techniques are not wholly reliable. When lsof does manage to break a block, it will report the break with an error message. The messages may be suppressed with the -t and -w options.
The default timeout value may be displayed with the -h or -? option, and it may be changed with the -S [t] option. The minimum for t is two seconds, but you should avoid small values, since slow system responsiveness can cause short timeouts to expire unexpectedly and perhaps stop lsof before it can produce any output.
When lsof has to break a block during its access of mounted file system information, it normally continues, although with less information available to display about open files.
Lsof can also be directed to avoid the protection of timers and child processes when using the kernel functions that might block by specifying the -O option. While this will allow lsof to start up with less overhead, it exposes lsof completely to the kernel situations that might block it. Use this option cautiously.
You can use the -b option to tell lsof to avoid using kernel functions that would block. Some cautions apply.
First, using this option usually requires that your system supply alternate device numbers in place of the device numbers that lsof would normally obtain with the (2) and stat(2) kernel functions. See the ALTERNATE DEVICE NUMBERS section for more information on alternate device numbers.
Second, you can't specify names for lsof to locate unless they're file system names. This is because lsof needs to know the device and inode numbers of files listed with names in the lsof options, and the -b option prevents lsof from obtaining them. Moreover, since lsof only has device numbers for the file systems that have alternates, its ability to locate files on file systems depends completely on the availability and accuracy of the alternates. If no alternates are available, or if they're incorrect, lsof won't be able to locate files on the named file systems.
Third, if the names of your file system directories that lsof obtains from your system's mount table are symbolic links, lsof won't be able to resolve the links. This is because the -b option causes lsof to avoid the kernel readlink(2) function it uses to resolve symbolic links.
Finally, using the -b option causes lsof to issue warning messages when it needs to use the kernel functions that the -b option directs it to avoid. You can suppress these messages by specifying the -w option, but if you do, you won't see the alternate device numbers reported in the warning messages.
On some dialects, when lsof has to break a block because it can't get information about a mounted file system via the (2) and stat(2) kernel functions, or because you specified the -b option, lsof can obtain some of the information it needs - the device number and possibly the file system type - from the system mount table. When that is possible, lsof will report the device number it obtained. (You can suppress the report by specifying the -w option.)
You can assist this process if your mount table is supported with an /etc/mtab or /etc/mnttab file that contains an options field by adding a ``dev=xxxx'' field for mount points that do not have one in their options strings.
The ``xxxx'' portion of the field is the hexadecimal value of the file system's device number. (Consult the st_dev field of the output of the (2) and stat(2) functions for the appropriate values for your file systems.) Here's an example from a Sun Solaris 2.6 /etc/mnttab for a file system remotely mounted via NFS:
nfs ignore,noquota,dev=2a40001
There's an advantage to having ``dev=xxxx'' entries in your mount table file, especially for file systems that are mounted from remote NFS servers. When a remote server crashes and you want to identify its users by running lsof on one of its clients, lsof probably won't be able to get output from the (2) and stat(2) functions for the file system. If it can obtain the file system's device number from the mount table, it will be able to display the files open on the crashed NFS server.
Some dialects that do not use an ASCII /etc/mtab or /etc/mnttab file for the mount table may still provide an alternative device number in their internal mount tables. This includes AIX, Apple Darwin, DEC OSF/1, Digital UNIX, FreeBSD, NetBSD, OpenBSD, and Tru64 UNIX. Lsof knows how to obtain the alternative device number for these dialects and uses it when its attempt to (2) or stat(2) the file system is blocked.
If you're not sure your dialect supplies alternate device numbers for file systems from its mount table, use this lsof incantation to see if it reports any alternate device numbers:
Look for standard error file warning messages that begin ``assuming "dev=xxxx" from ...''.
Lsof is able to examine the kernel's name cache or use other kernel facilities (e.g., the ADVFS 4.x tag_to_path() function under Digital UNIX or Tru64 UNIX) on some dialects for most file system types, excluding AFS, and extract recently used path name components from it. (AFS file system path lookups don't use the kernel's name cache.)
Lsof reports the complete paths it finds in the NAME column. If lsof can't report all components in a path, it reports in the NAME column the file system name, followed by a space, two `-' characters, another space, and the name components it has located, separated by the `/' character.
When lsof is run in repeat mode - i.e., with the -r option specified - the extent to which it can report path name components for the same file may vary from cycle to cycle. That's because other running processes can cause the kernel to remove entries from its name cache and replace them with others.
Lsof's use of the kernel name cache to identify the paths of files can lead it to report incorrect components under some circumstances. This can happen when the kernel name cache uses device and node number as a key (e.g., Linux and SCO OpenServer) and a key on a rapidly changing file system is reused. If the UNIX dialect's kernel doesn't purge the name cache entry for a file when it is unlinked, lsof may find a reference to the wrong entry in the cache. The lsof FAQ (The FAQ section gives its location.) has more information on this situation.
Lsof can report path name components for these dialects:
BSDI BSD/OS DC/OSx DEC OSF/1, Digital UNIX, Tru64 UNIX FreeBSD HP-UX Linux NetBSD NEXTSTEP OpenBSD Reliant UNIX Caldera OpenUNIX SCO OpenServer SCO UnixWare Solaris
Lsof can't report path name components for these dialects:
AIX
If you want to know why lsof can't report path name components for some dialects, see the lsof FAQ (The FAQ section gives its location.)
Examining all members of the /dev (or /devices) node tree with stat(2) functions can be time consuming. What's more, the information that lsof needs - device number, inode number, and path - rarely changes.
Consequently, lsof normally maintains an ASCII text file of cached /dev (or /devices) information (exception: the /proc-based Linux lsof where it's not needed.) The local system administrator who builds lsof can control the way the device cache file path is formed, selecting from these options:
Path from the -D option; Path from an environment variable; System-wide path; Personal path (the default); Personal path, modified by an environment variable.
Consult the output of the -h, -D? , or -? help options for the current state of device cache support. The help output lists the default read-mode device cache file path that is in effect for the current invocation of lsof. The -D? option output lists the read-only and write device cache file paths, the names of any applicable environment variables, and the personal device cache path format.
Lsof can detect that the current device cache file has been accidentally or maliciously modified by integrity checks, including the computation and verification of a sixteen bit Cyclic Redundancy Check (CRC) sum on the file's contents. When lsof senses something wrong with the file, it issues a warning and attempts to remove the current cache file and create a new copy, but only to a path that the process can legitimately write.
The path from which a lsof process may attempt to read a device cache file may not be the same as the path to which it can legitimately write. Thus when lsof senses that it needs to update the device cache file, it may choose a different path for writing it from the path from which it read an incorrect or outdated version.
If available, the -Dr option will inhibit the writing of a new device cache file. (It's always available when specified without a path name argument.)
When a new device is added to the system, the device cache file may need to be recreated. Since lsof compares the mtime of the device cache file with the mtime and ctime of the /dev (or /devices) directory, it usually detects that a new device has been added; in that case lsof issues a warning message and attempts to rebuild the device cache file.
Whenever lsof writes a device cache file, it sets its ownership to the real UID of the executing process, and its permission modes to 0600, this restricting its reading and writing to the file's owner.
Two permissions of the lsof executable affect its ability to access device cache files. The permissions are set by the local system administrator when lsof is installed.
The first and rarer permission is setuid-root. It comes into effect when lsof is executed; its effective UID is then root, while its real (i.e., that of the logged-on user) UID is not. The lsof distribution recommends that versions for these dialects run setuid-root.
DC/OSx 1.1 for Pyramid systems Reliant UNIX 5.4[34] for Pyramid systems
The second and more common permission is setgid. It comes into effect when the effective group IDentification number (GID) of the lsof process is set to one that can access kernel memory devices - e.g., ``kmem'', ``sys'', or ``system''.
An lsof process that has setgid permission usually surrenders the permission after it has accessed the kernel memory devices. When it does that, lsof can allow more liberal device cache path formations. The lsof distribution recommends that versions for these dialects run setgid and be allowed to surrender setgid permission.
AIX 4.3.[23], 5L, and 5.1 Apple Darwin 1.[23] and 1.4 for Power Macintosh systems BSDI BSD/OS 4.1 for Intel-based systems DEC OSF/1, Digital UNIX, Tru64 UNIX 4.0, and 5.[01] FreeBSD 4.[2345] and 5.0 for Intel-based systems HP-UX 11.00 NetBSD 1.5 for Alpha, Intel, and SPARC-based systems NEXTSTEP 3.[13] for NEXTSTEP architectures OpenBSD 2.[89] and 3.0 for Intel-based systems Caldera OpenUNIX SCO OpenServer Release 5.0.[46] for Intel-based systems SCO UnixWare 7.1.1 for Intel-based systems Solaris 2.6, 7, 8, and 9 BETA-Refresh
(Note: lsof for AIX 5L and above needs setuid-root permission if its -X option is used.)
Lsof for these dialects does not support a device cache, so the permissions given to the executable don't apply to the device cache file.
Linux 2.1.72 and above (/proc-based lsof)
The -D option provides limited means for specifying the device cache file path. Its ? function will report the read-only and write device cache file paths that lsof will use.
When the -D b, r, and u functions are available, you can use them to request that the cache file be built in a specific location (b[path]); read but not rebuilt (r[path]); or read and rebuilt (u[path]). The b, r, and u functions are restricted under some conditions. They are restricted when the lsof process is setuid-root. The path specified with the r function is always read-only, even when it is available.
The b, r, and u functions are also restricted when the lsof process runs setgid and lsof doesn't surrender the setgid permission. (See the LSOF PERMISSIONS THAT AFFECT DEVICE CACHE FILE ACCESS section for a list of implementations that normally don't surrender their setgid permission.)
A further -D function, i (for ignore), is always available.
When available, the b function tells lsof to read device information from the kernel with the stat(2) function and build a device cache file at the indicated path.
When available, the r function tells lsof to read the device cache file, but not update it. When a path argument accompanies -Dr, it names the device cache file path. The r function is always available when it is specified without a path name argument. If lsof is not running setuid-root and surrenders its setgid permission, a path name argument may accompany the r function.
When available, the u function tells lsof to attempt to read and use the device cache file. If it can't read the file, or if it finds the contents of the file incorrect or outdated, it will read information from the kernel, and attempt to write an updated version of the device cache file, but only to a path it considers legitimate for the lsof process effective and real UIDs.
Lsof's second choice for the device cache file is the contents of the LSOFDEVCACHE environment variable. It avoids this choice if the lsof process is setuid-root, or the real UID of the process is root.
A further restriction applies to a device cache file path taken from the LSOFDEVCACHE environment variable: lsof will not write a device cache file to the path if the lsof process doesn't surrender its setgid permission. (See the LSOF PERMISSIONS THAT AFFECT DEVICE CACHE FILE ACCESS section for information on implementations that don't surrender their setgid permission.)
The local system administrator can disable the use of the LSOFDEVCACHE environment variable or change its name when building lsof. Consult the output of -D? for the environment variable's name.
The local system administrator may choose to have a system-wide device cache file when building lsof. That file will generally be constructed by a special system administration procedure when the system is booted or when the contents of /dev or /devices) changes. If defined, it is lsof's third device cache file path choice.
You can tell that a system-wide device cache file is in effect for your local installation by examining the lsof help option output - i.e., the output from the -h or -? option.
Lsof will never write to the system-wide device cache file path by default. It must be explicitly named with a -D function in a root-owned procedure. Once the file has been written, the procedure must change its permission modes to 0644 (owner-read and owner-write, group-read, and other-read).
The default device cache file path of the lsof distribution is one recorded in the home directory of the real UID that executes lsof. Added to the home directory is a second path component of the form .lsof_hostname.
This is lsof's fourth device cache file path choice, and is usually the default. If a system-wide device cache file path was defined when lsof was built, this fourth choice will be applied when lsof can't find the system-wide device cache file. This is the only time lsof uses two paths when reading the device cache file.
The hostname part of the second component is the base name of the executing host, as returned by gethostname(2). The base name is defined to be the characters preceding the first `.' in the gethostname(2) output, or all the gethostname(2) output if it contains no `.'.
The device cache file belongs to the user ID and is readable and writable by the user ID alone - i.e., its modes are 0600. Each distinct real user ID on a given host that executes lsof has a distinct device cache file. The hostname part of the path distinguishes device cache files in an NFS-mounted home directory into which device cache files are written from several different hosts.
The personal device cache file path formed by this method represents a device cache file that lsof will attempt to read, and will attempt to write should it not exist or should its contents be incorrect or outdated.
The -Dr option without a path name argument will inhibit the writing of a new device cache file.
The -D? option will list the format specification for constructing the personal device cache file. The conversions used in the format specification are described in the 00DCACHE file of the lsof distribution.
If this option is defined by the local system administrator when lsof is built, the LSOFPERSDCPATH environment variable contents may be used to add a component of the personal device cache file path.
The LSOFPERSDCPATH variable contents are inserted in the path at the place marked by the local system administrator with the ``%p'' conversion in the HASPERSDC format specification of the dialect's machine.h header file. (It's placed right after the home directory in the default lsof distribution.)
Thus, for example, if LSOFPERSDCPATH contains ``LSOF'', the home directory is ``/Homes/abe'', the host name is ``vic.cc.purdue.edu'', and the HASPERSDC format is the default (``%h/%p.lsof_%L''), the modified personal device cache file path is:
/Homes/abe/LSOF/.lsof_vic
The LSOFPERSDCPATH environment variable is ignored when the lsof process is setuid-root or when the real UID of the process is root.
Lsof will not write to a modified personal device cache file path if the lsof process doesn't surrender setgid permission. (See the LSOF PERMISSIONS THAT AFFECT DEVICE CACHE FILE ACCESS section for a list of implementations that normally don't surrender their setgid permission.)
If, for example, you want to create a sub-directory of personal device cache file paths by using the LSOFPERSDCPATH environment variable to name it, and lsof doesn't surrender its setgid permission, you will have to allow lsof to create device cache files at the standard personal path and move them to your subdirectory with shell commands.
The local system administrator may: disable this option when lsof is built; change the name of the environment variable from LSOFPERSDCPATH to something else; change the HASPERSDC format to include the personal path component in another place; or exclude the personal path component entirely. Consult the output of the -D? option for the environment variable's name and the HASPERSDC format specification.
Lsof returns a one (1) if any error was detected, including the failure to locate command names, file names, Internet addresses or files, login names, NFS files, PIDs, PGIDs, or UIDs it was asked to list. If the -V option is specified, lsof will indicate the search items it failed to list.
It returns a zero (0) if no errors were detected and if it was able to list some information about all the specified search arguments.
When lsof cannot open access to /dev (or /devices) or one of its subdirectories, or get information on a file in them with stat(2), it issues a warning message and continues. That lsof will issue warning messages about inaccessible files in /dev (or /devices) is indicated in its help output - requested with the -h or >B -? options - with the message:
Inaccessible /dev warnings are enabled.
The warning message may be suppressed with the -w option. It may also have been suppressed by the system administrator when lsof was compiled by the setting of the WARNDEVACCESS definition. In this case, the output from the help options will include the message:
Inaccessible /dev warnings are disabled.
Inaccessible device warning messages usually disappear after lsof has created a working device cache file.
To list all open files, use:
To list all open Internet, x.25 (HP-UX), and UNIX domain files, use:
To list all open IPv4 network files in use by the process whose PID is 1234, use:
Presuming the UNIX dialect supports IPv6, to list only open IPv6 network files, use:
To list all files using any protocol on ports 513, 514, or 515 of host wonderland.cc.purdue.edu, use:
To list all files using any protocol on any port of mace.cc.purdue.edu (cc.purdue.edu is the default domain), use:
To list all open files for login name ``abe'', or user ID 1234, or process 456, or process 123, or process 789, use:
To list all open files on device /dev/hd4, use:
To find the process that has /u/abe/foo open, use:
To send a SIGHUP to the processes that have /u/abe/bar open, use:
To find any open file, including an open UNIX domain socket file, with the name /dev/log, use:
To find processes with open files on the NFS file system named /nfs/mount/point whose server is inaccessible, and presuming your mount table supplies the device number for /nfs/mount/point, use:
To do the preceding search with warning messages suppressed, use:
To ignore the device cache file, use:
To obtain PID and command name field output for each process, file descriptor, file device number, and file inode number for each file of each process, use:
To list the files at descriptors 1 and 3 of every process running the lsof command for login ID ``abe'' every 10 seconds, use:
To list the current working directory of processes running a command that is exactly four characters long and has an 'o' or 'O' in character three, use this regular expression form of the -c c option:
To find an IP version 4 socket file by its associated numeric dot-form address, use:
To find an IP version 6 socket file (when the UNIX dialect supports IPv6) by its associated numeric colon-form address, use:
To find an IP version 6 socket file (when the UNIX dialect supports IPv6) by an associated numeric colon-form address that has a run of zeroes in it - e.g., the loop-back address - use:
When a file has multiple record locks, the lock status character (following the file descriptor) is derived from a test of the first lock structure, not from any combination of the individual record locks that might be described by multiple lock structures.
Lsof can't search for files with restrictive access permissions by name unless it is installed with root set-UID permission. Otherwise it is limited to searching for files to which its user or its set-GID group (if any) has access permission.
The display of the destination address of a raw socket (e.g., for ping) depends on the UNIX operating system. Some dialects store the destination address in the raw socket's protocol control block, some do not.
Lsof can't always represent Solaris device numbers in the same way that ls(1) does. For example, the major and minor device numbers that the (2) and stat(2) functions report for the directory on which CD-ROM files are mounted (typically /cdrom) are not the same as the ones that it reports for the device on which CD-ROM files are mounted (typically /dev/sr0). (Lsof reports the directory numbers.)
The support for /proc file systems is available only for BSD, DEC OSF/1, Digital UNIX, and Tru64 UNIX dialects, Linux, and dialects derived from SYSV R4 - e.g., FreeBSD, NetBSD, OpenBSD, Solaris, UnixWare.
Some /proc file items - device number, inode number, and file size - are unavailable in some dialects. Searching for files in a /proc file system may require that the full path name be specified.
No text (txt) file descriptors are displayed for Linux processes. All entries for files other than the current working directory, the root directory, and numerical file descriptors are labeled mem descriptors.
Lsof can't search for DEC OSF/1, Digital UNIX, and Tru64 UNIX named pipes by name, because their kernel implementation of (2) returns an improper device number for a named pipe.
Lsof can't report fully or correctly on HP-UX 9.01, 10.20, and 11.00 locks because of insufficient access to kernel data or errors in the kernel data. See the lsof FAQ (The FAQ section gives its location.) for details.
The AIX SMT file type is a fabrication. It's made up for file structures whose type (15) isn't defined in the AIX /usr/include/sys/file.h header file. One way to create such file structures is to run X clients with the DISPLAY variable set to ``:0.0''.
The +|-f[cfgGn] option is not supported under /proc-based Linux lsof, because it doesn't read kernel structures from kernel memory.
That file is also available via anonymous ftp from vic.cc.purdue.edu at pub/tools/unix/lsofFAQ. The URL is:
You can also use this URL:
Lsof is also mirrored elsewhere. When you access vic.cc.purdue.edu and change to its pub/tools/unix/lsof directory, you'll be given a list of some mirror sites. The pub/tools/unix/lsof directory also contains a more complete list in its mirrors file. Use mirrors with caution - not all mirrors always have the latest lsof revision.
Some pre-compiled Lsof executables are available on vic.cc.purdue.edu, but their use is discouraged - it's better that you build your own from the sources. If you feel you must use a pre-compiled executable, please read the cautions that appear in the README files of the pub/tools/unix/lsof/binaries subdirectories and in the 00* files of the distribution.
More information on the lsof distribution can be found in its README.lsof_<version> file. If you intend to get the lsof distribution and build it, please read README.lsof_<version> and the other 00* files of the distribution before sending questions to the author.
Lsof versions 2 and 3 have been tested under older UNIX dialects. They are available via anonymous ftp from vic.cc.purdue.edu in the pub/tools/unix/lsof/OLD directory.
access(2), awk(1), crash(1), fattach(3C), ff(1), fstat(8), fuser(1), gethostname(2), isprint(3), kill(1), (2), modload(8), mount(8), netstat(1), ofiles(8L), perl(1), ps(1), readlink(2), stat(2), uname(1).
Society
Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers : Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism : The Iron Law of Oligarchy : Libertarian Philosophy
Quotes
War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda : SE quotes : Language Design and Programming Quotes : Random IT-related quotes : Somerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose Bierce : Bernard Shaw : Mark Twain Quotes
Bulletin:
Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 : Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law
History:
Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds : Larry Wall : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOS : Programming Languages History : PL/1 : Simula 67 : C : History of GCC development : Scripting Languages : Perl history : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history
Classic books:
The Peter Principle : Parkinson Law : 1984 : The Mythical Man-Month : How to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite
Most popular humor pages:
Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor
The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
|
You can use PayPal to to buy a cup of coffee for authors of this site |
Disclaimer:
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.
Last modified: February 29, 2020