5. use the lso 1, introduction to use lsof lsof, you can check for open files, and, if necessary, suspend the corresponding before uninstalling process.
Similarly, if you discover an unknown file, so you can find out exactly which application opens the file. In UNIX ® environment, the file is everywhere, this results in a maxim: "everything is a file". You can access through file not only conventional data, usually you can also access network connectivity, and hardware. In some cases, when you use the ls request directory listing the appropriate entries. In other cases, such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) socket, the absence of appropriate directory listing. But in the background as the application assigned to a file descriptor, regardless of the nature of the file, the file descriptor for the application and the underlying operating system interaction provides a common interface. Because the application open file descriptor lists provide a great deal about the application itself, so to be able to view this list would be very helpful. To accomplish this task of utility called lsof, which corresponds to the "listopenfiles" (list open files). Almost every UNIX versions have this utility. 2. download and install # lsof wgetftp://ftp.sunfreeware.com/pub/freeware/intel/10/lsof-4.77-sol10-x86-local.gz # gunziplsof-4.77-sol10-x86-local.gz # pkgadd-dlsof-4.77-sol10-x86-local 3, lsof use simply enter lsof can generate large amounts of information, as shown in Figure 7. Since lsof needs access to core memory and all kinds of files, so you must run as root user, it will be able to fully play their role. Figure 7lsof displays each row displays an open file, unless otherwise specified, displays all all files opened the process. Command, the PID and User columns represent the process name, process ID (PID) and the owner name. Device, SIZE/OFF, Node, and Name the column relates to the files themselves, respectively, representing the specified disk name, file size, the index node (file on a disk identifier) and the exact name of the file. Depending on the version of UNIX, you may report the size of the file as the application reads the file's current location (offset). Figure 5 from one can report this information SunSolaris10 computers, Linux ® does not have this function. Find a network connection to the network connection is file, this means that you can use lsof to obtain information about them. Suppose you already know the PID, but sometimes this is not the case. If you only know the appropriate ports, you can use the-I parameter information using sockets. Figure 6 shows on TCP port 22 on searches. # Lsof-i:22 search active connection # lsof-i  @ 192.168.1.11
No comments:
Post a Comment