5

When I run lsof command, in name column, for sockets, some numbers are coming in bracket as shown below. What does it mean?

 command    pid        user      fd                 Name
 process    8197       root      29                 socket:[3050474]
Sam Protsenko
  • 14,045
  • 4
  • 59
  • 75

1 Answers1

5

TL;DR: A unique number associated with that socket


One of the defining rules of Unix is "Everything is a file". Because of that sockets are also represented by very special filesystem, usually referred as sockfs.

Files on traditional filesystems have inode-numbers -- unique numbers that allow to identify them:

$ ls -li /bin/bash 
7864369 -rwxr-xr-x 1 root root 656584 Oct 15  2014 /bin/bash
^^^^^^^
inode-number

Same applies to a sockfs, all sockets also have inode-numbers.

For special filesystems, that doesn't have actual filenaming schema, all files have generic names in form fsname:[inode-number] (see also: linux+v3.19.1/fs/dcache.c#L2945)

myaut
  • 11,174
  • 2
  • 30
  • 62