Linux Command sharing: lsof command, linux Command sharing lsof
Lsof (listopenfiles) is a tool used to list open files in the current system. In linux, everything exists in the form of a file. Through a file, you can not only acc
Lsof (list open files) is a tool that lists open files for the current system. In a Linux environment, everything is in the form of files, with files that not only access regular data, but also access to network connectivity and hardware. So, Lsof is a powerful feature. The general root user can execute the lsof command
(can be more than one)lsof Use InstancesFind who is using the file systemWhen uninstalling a file system, the operation will typically fail if there are any open files in the file system. Then through lsof you can find out which processes are using the file system that is currently being uninstalled, as follows:# Lsof/gtes11/
specifying that all the files opened by the process are displayed by default. The meaning of the lsof output column information is as follows: COMMAND: Process name PID: Process identifier USER: Process owner FD: A file descriptor that the application identifies with the file descriptor, such as CWD, TXT, and so on. Type: File types, such as: DIR, Reg, and so on. DEVICE: Specify the name of the disk
one)Lsof Use InstancesFind who is using the file systemWhen uninstalling a file system, the operation will typically fail if there are any open files in the file system. Then through lsof you can find out which processes are using the file system that is currently being uninstalled, as follows:# lsof/gtes11/COMMAND PI
2/Init1Root RTD DIR3,3 1024x768 2/Init1Root txt REG3,3 38432 1763452/sbin/Init init1Root Mem REG3,3 106114 1091620/lib/libdl-2.6. So init1Root Mem REG3,3 7560696 1091614/lib/libc-2.6. So init1Root Mem REG3,3 79460 1091669/lib/libselinux.so.1Init1Root Mem REG3,3 223280 1091668/lib/libsepol.so.1Init1Root Mem REG3,3 564136 1091607/lib/LD-2.6. So init1Root10uFifo0, the 1309/dev/initctl Each row displays
1. Recursively view file information for a directory: Lsof test/test12. Do not use the +D option to traverse through all file information for a directory: lsof |grep ' Test/test3 '3. List the file information opened by a User: Lsof-u username4. List the file information opened by a program process: Lsof-c MySQL5. List
Original URL: http://www.cnblogs.com/peida/archive/2013/02/26/2932972.htmlLsof (list open files) is a tool that lists open files for the current system. In a Linux environment, everything is in the form of files, with files that not only access regular data, but also access to network connectivity and hardware. So, such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) sockets, the system assigns a file descriptor to the application in the background, regardless of the natu
When the lsof (listopenfiles) command is used to detach a mobile storage, devicebusy is often prompted, and a file that is being opened may be deleted by mistake .... At this time, you can try lsoflsof introduction lsof (listopenfiles) is a tool to list open files in the current system... when the lsof (list open files
When the lsof (list open files) command is used to detach a mobile storage, device busy is often prompted. A file that is being opened may also be deleted by mistake .... At this time, you can try lsof introduction lsof (list open files) is a tool to list open files in the current system. In linux, everything exists in
Tags:/usr System Monitor toolbar how for error type ROR linklsof Command IntroductionLsof (list open files) is a tool that lists open files for the current system. In a Linux environment, everything is in the form of files, with files that not only access regular data, but also access to network connectivity and hardware. such as TC and UDP, the system assigns a file descriptor to the application in the background, regardless of the nature of the file
Lsof (list open files) is a tool that lists open files for the current system. In a Linux environment, everything is in the form of files, with files that not only access regular data, but also access to network connectivity and hardware. So, such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) sockets, the system assigns a file descriptor to the application in the background, regardless of the nature of the file, which provide
applications open files with FD starting from 3.The Type column is more intuitive than the FD column. Files and directories are called REG and Dir, respectively. The CHR and BLK, respectively, represent characters and block devices, or UNIX, FIFO, and IPV4, respectively, representing the UNIX domain sockets, first in and Out (FIFO) queues, and Internet Protocol (IP) sockets.Common Parameterslsof syntax format is: lsof [options] FileName4 shows a proc
Recently discovered that the LOSF command is particularly useful in system administration, summarizing the information I have collected as follows1. When there are no parameters behind lsof, the command will list all files that are open by all processes in the current system#lsof |NL #nl命令打印出行号2. The following commands
for verification. The lsof syntax format is:lsof [options] FileNamelsof filename Displays all open files for all processes that open the specified file lsof-a indicates that two parameters must be met when the result lsof-c string displays the command column that contains the specified characters
What is the lsof command?
Lists information about files opened by processes. The opened file can be
1. Common files
2. Directory
3. Network File System Files
4. Character Device File
5. (function) Shared Library
6. Pipe, Named Pipe
7. Symbolic Links
8. Underlying socket text stream, network socket, and Unix domain socket
How to Use lsof
Here we
Lsof (list open files) is a tool that lists open files for the current system . In a Linux environment, everything is in the form of files, with files that not only access regular data, but also access to network connectivity and hardware. So, such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) sockets, the system assigns a file descriptor to the application in the background, regardless of the nature of the file, which provid
Enter lsof under the terminal to display the system open files, because the lsof need to access core memory and various files, so you must run it as root to fully perform its function
LSOF-PNL +m-i4LSOF-PNL +m-i6Ls-i: 80
Add: Practical command
The code is as follows
Copy Code
one) in the service port--Port number (can be more than one)Utility Commands:Lsof ' which httpd '//that process is using Apache's executable filelsof/etc/passwd//that process is taking up/etc/passwd .Lsof/dev/hda6//that process is taking up Hda6 .Lsof/dev/cdrom//that process is taking up the optical drive .Lsof-c SendMail//view file Usage for the sendmail proces
1. Use the lsof command line to list all open files
# lsof
This is a very long list, including open files and networks
The above screen contains many columns, such as PID, user, FD, and TYPE.
FD - File descriptor
The FD column contains such values.
cwd - Current working directorytxt - Text filemem - Memory Mapped filemmap - Memory Mapped deviceNumber - It repre
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.