Section courante

A propos

Section administrative du site

 Système d'exploitation  Installation  Utilisation  Tutoriel  Programmation  Outils  Annexe  Aide 
Amiga
Apple
CP/M / DOS
CoCo
Cray
Mainframe
Mobile
OS/2
TRS-80
UNIX
Windows
Autres
AmigaDOS
AmigaOS
MorphOS
Apple DOS
System 1.0
System 1.1
System 2.0
System 3.0
System 3.1
System 3.2
System 3.3
System 4.0
System 4.1
System 4.2
System 4.3
System 6.0
System 7.0
System 7.1
System 7.5
System 7.6
Mac OS 8.0
Mac OS 8.1
Mac OS 8.5
Mac OS 8.6
Mac OS 9.0
Mac OS 9.1
Mac OS 9.2
Mac OS X
Mac OS X Server
Apple DOS
Caldera DR-DOS 7
CP/M
CP/M-80
CP/M-86
DOS
DR-DOS
FreeDOS
IBM DOS 4
IBM DOS 5
MS-DOS
PC DOS
PTS-DOS
DR-DOS 5
DR-DOS 6
DR-DOS 7
MS-DOS 1.25
MS-DOS 2.0
MS-DOS 2.11
MS-DOS 3.0
MS-DOS 3.20
MS-DOS 3.21
MS-DOS 3.3
MS-DOS 4
MS-DOS 5
MS-DOS 6
MS-DOS 6.2
MS-DOS 7.10
PC DOS 1.0
PC DOS 1.1
PC DOS 2.0
PC DOS 2.1
PC DOS 3.0
PC DOS 3.1
PC DOS 3.2
PC DOS 3.3
PC DOS 4.0
PC DOS 4.01
PC DOS 5.0
PC DOS 6.1
PC DOS 6.3
PC DOS 7.0
PC DOS 2000
FLEX
OS-9
COS
UNICOS
OpenVMS
OS/390
OS/400
VAX/VMS
z/OS
Android OS
Bada
EPOC
PalmOS
Citrix Multiuser
eComStation
OS/2 Version 1
OS/2 Version 1.1
OS/2 Version 1.2
OS/2 Version 1.3
OS/2 Version 2
OS/2 Version 2.1
OS/2 Warp 3
OS/2 Warp 4
LDOS
MultiDOS
NEWDOS
TRSDOS
AIX
FreeBSD
HP-UX
Linux
QNX
SkyOS
Solaris (SunOS)
UNIX
XENIX
ReactOS
Windows 95
Windows 98
Windows Me
Windows NT 4.0 Server
Windows 2000 Professionnel
Windows 2000 Server
Windows XP
Windows Server 2003
Windows Server 2003 R2
Windows Server 2008
Windows Server 2008 R2
Windows Server 2012
Windows Server 2012 R2
Windows Server 2016
Windows Server 2019
Windows Vista
Windows 7
Windows 8
Windows 10
Windows 11
FLEX
KolibriOS
Inferno
Medos-2
Oberon
Plan 9
p-System
RDOS
CentOS
Corel Linux 1.2
Debian GNU/Linux 7.5
Lindows 4.0.302
openSUSE 11.2
Red Hat Linux 9.0
Red Star Desktop 3.0
TurnKey Core
Ubuntu 9.10
CentOS 6.5
CentOS 7
Installer Python 2.7 pour utilisateur unique sous CentOS 5.8
Introduction
Références des distributions
Références des commandes
Références des fichiers
CentOS
Debian
Fedora
openSUSE
Red Hat Linux
Slackware
TurboLinux
Ubuntu
Utilitaire
Niveau
Catégorie
Déterminer la version
Copier des répertoires
Les partitions
Les groupes
C pour Linux
Pascal pour Linux
AWK
BASH
C Shell
Free Pascal
MySQL
Perl
Python
TCL
Yabasic
Interruption 80h
MobaXterm
putty
Ext2, Ext3 & Ext4
Base de connaissances
Bibliographie
Préface
Notes légal
Dictionnaire
Recherche

lsof

Liste des fichiers ouvert
Linux Externe

Syntaxe

lsof [-?abhlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-f[gG]] [+|-e s] [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s] [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]

Paramètres

Nom Description
-? Ce paramètre permet d'afficher l'écran d'aide.
-h Ce paramètre permet d'afficher l'écran d'aide.
-a Ce paramètre d'indiquer un sélecteur d'option «ET».
-b Ce paramètre permet d'indiquer qu'il faut éviter le blocage du noyau.
-c c Ce paramètre permet d'indiquer la liste des fichiers de processus exécuté par la commande commençant par le caractère spécifié.
... ...

Description

Cette commande permet d'afficher divers informations à propos des fichiers ouvert par des processus.

Installation

Si la commande n'est pas installé, il est possible de l'installer de la façon suivante :

yum install lsof

Exemples

Cet exemple permet d'afficher le processus utilisant le port 80 du protocole TCP sur le système d'exploitation :

lsof -i tcp:80

on obtiendra un résultat ressemblant parfois à ceci (très variable d'une machine à l'autre) :

COMMAND    PID       USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
httpd     2098       root    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     2121     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     2122     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     2123     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     2124     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     2125     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     2126     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     2127     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     2128     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
clock-app 9240 integrator   21u  IPv4 147215      0t0  TCP 10.0.2.15:49897->24.24.24.24:http (ESTABLISHED)
httpd     9292     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     9596     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     9652     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)
httpd     9723     apache    4u  IPv6  11736      0t0  TCP *:http (LISTEN)

L'exemple suivant permet de vérifier si des utilisateurs utilisent actuellement le fichier «.xsession-errors» :

lsof .xsession-errors

on obtiendra le résultat semblable suivant :

COMMAND    PID       USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
gnome-ses 10274 gladir       1u   REG  :253,0     1026 8155 .xsession-errors
gnome-ses 10274 gladir       2u   REG  253,0     1026 8155 .xsession-errors

La commande suivant permet de voir tous les opérations effectué sur des fichiers dans la partition du système de fichiers pour le processus «php» :

lsof -c php


PARTAGER CETTE PAGE SUR
Dernière mise à jour : Mercredi, le 30 septembre 2015