[20201103]lsof顯示link=0的檔案.txt
[20201103]lsof顯示link=0的檔案.txt
--//有時候一些檔案某些程式開啟了檔案控制程式碼,而使用rm刪除是無法回收使用空間的,如果出現這樣的情況,檢視這些依然開啟的檔案,
--//我以前的查詢方式使用grep過濾。
# lsof | egrep "COMMAND|deleted"
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
bash 8313 root txt REG 104,2 768952 10715145 /bin/bash (deleted)
bash 8351 root txt REG 104,2 768952 10715145 /bin/bash (deleted)
bash 8387 root txt REG 104,2 768952 10715145 /bin/bash (deleted)
rsyslogd 14220 root txt REG 104,2 267608 5603400 /sbin/rsyslogd (deleted)
--//實際上lsof支援顯示檔案link的計數:
+|-L [l] This option enables ('+') or disables ('-') the listing of file link counts, where they are available - e.g.,
they aren't available for sockets, or most FIFOs and pipes.
When +L is specified without a following number, all link counts will be listed. When -L is specified (the
default), no link counts will be listed.
When +L is followed by a number, only files having a link count less than that number will be listed. (No
number may follow -L.) A specification of the form ''+L1'' will select open files that have been unlinked. A
specification of the form ''+aL1 <file_system>'' will select unlinked open files on the specified file
system.
For other link count comparisons, use field output (-F) and a post-processing script or program.
--//+L numbner,僅僅顯示小於number的記錄。
# lsof +L 1
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
bash 8313 root txt REG 104,2 768952 0 10715145 /bin/bash (deleted)
bash 8351 root txt REG 104,2 768952 0 10715145 /bin/bash (deleted)
bash 8387 root txt REG 104,2 768952 0 10715145 /bin/bash (deleted)
rsyslogd 14220 root txt REG 104,2 267608 0 5603400 /sbin/rsyslogd (deleted)
# lsof +L1
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
bash 8313 root txt REG 104,2 768952 0 10715145 /bin/bash (deleted)
bash 8351 root txt REG 104,2 768952 0 10715145 /bin/bash (deleted)
bash 8387 root txt REG 104,2 768952 0 10715145 /bin/bash (deleted)
rsyslogd 14220 root txt REG 104,2 267608 0 5603400 /sbin/rsyslogd (deleted)
# lsof +aL1
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
bash 8313 root txt REG 104,2 768952 0 10715145 /bin/bash (deleted)
bash 8351 root txt REG 104,2 768952 0 10715145 /bin/bash (deleted)
bash 8387 root txt REG 104,2 768952 0 10715145 /bin/bash (deleted)
rsyslogd 14220 root txt REG 104,2 267608 0 5603400 /sbin/rsyslogd (deleted)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2731783/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20220826]顯示alert日誌檔案全路徑.txt
- [20201103]Martian Packets.txt
- [20220826]ls顯示檔案不區分大小寫.txt
- 電腦TXT檔案怎麼顯示行數? 電腦TXT檔案行數檢視方法
- [20201103]set newname for datafile.txt
- mac顯示隱藏檔案,取消顯示隱藏檔案Mac
- Mac顯示/不顯示隱藏檔案教程!Mac
- [linux] fuser程式顯示檔案Linux
- [20190321]smem的顯示缺陷.txt
- link/Extended dependency 無法顯示連線
- git status顯示了未修改的檔案Git
- MACOS 如何顯示隱藏檔案Mac
- 【macOS】顯示/隱藏 指定檔案Mac
- 電腦檔案字尾名怎麼顯示?電腦中顯示檔案字尾(副檔名)的設定方法
- win10怎麼顯示檔案字尾_window10如何顯示檔案字尾副檔名Win10
- chm 檔案開啟只顯示目錄,不顯示內容
- mac 隱藏檔案顯示 快捷鍵Mac
- 限制檔案大小及顯示檔案大小(正規表示式
- [20231207]ls -f的顯示問題.txt
- Java IntelliJ IDEA 不能顯示專案裡的檔案結構JavaIntelliJIdea
- [20180811]windows 7 顯示桌面.txtWindows
- [20211020]奇怪lsnrctl status顯示.txt
- win10為什麼電腦檔案無法顯示大小_win10系統顯示檔案大小的方法Win10
- [20180608]asmcmd顯示檔案的日期時間問題ASM
- win10怎麼顯示隱藏檔案_Win10系統顯示隱藏檔案步驟Win10
- html如何根據檔案路徑顯示檔案內容(pdf)HTML
- Word圖示未顯示在.doc和.docx文件檔案
- Mac OS X 顯示和隱藏檔案Mac
- 轉:vscode 檔案標籤欄多行顯示VSCode
- idea配置檔案.properties中文亂碼顯示????Idea
- 讓windows系統顯示隱藏檔案Windows
- [20230405]奇怪的顯示輸出寬度.txt
- qt 使用qmake pro檔案新增 ico圖示,程式執行時顯示圖示,exe也顯示圖示QT
- Linux中如何設定顯示檔案的前幾行?Linux
- [20190412]bash顯示日期相減.txt
- [20180628]顯示bbed x命令格式.txt
- [20210301]延遲顯示輸出.txt
- win10桌面檔案被隱藏如何顯示_win10怎麼顯示桌面隱藏檔案Win10