Postgres 筆記 - Ken

2023年5月29日 星期一

LInux 檢查各 Process 開檔案數量方法

檢查 /proc/<x>/fd/ 目錄的檔案數量可以用來查看對應 Process 開檔數量

透過 find 指令查詢全部 Process  開檔狀況

find /proc/*/fd -maxdepth 0 -print0 | xargs -0 -I{} sh -c 'printf "%4d : %s\n" "$(ls {}| wc -l)" "{}"'

參考資料:
https://stackoverflow.com/questions/15216370/how-to-count-number-of-files-in-each-directory
https://blog.csdn.net/weixin_34773479/article/details/112335204?spm=1001.2101.3001.6650.4&utm_medium=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-4-112335204-blog-89020809.235%5Ev36%5Epc_relevant_default_base&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-4-112335204-blog-89020809.235%5Ev36%5Epc_relevant_default_base&utm_relevant_index=3
on 5月 29, 2023
以電子郵件傳送這篇文章BlogThis!分享至 X分享至 Facebook分享到 Pinterest
較新的文章 較舊的文章 首頁

網頁

  • 首頁

日期

  • 9月 2023 (1)
  • 8月 2023 (2)
  • 7月 2023 (2)
  • 6月 2023 (4)
  • 5月 2023 (5)
  • 4月 2023 (1)
  • 2月 2023 (1)
  • 9月 2022 (1)
  • 7月 2022 (2)
  • 4月 2022 (1)
  • 3月 2022 (2)
  • 10月 2021 (1)
  • 9月 2021 (1)
  • 8月 2021 (5)

標籤

  • EnterpriseDB
  • Logical Replication
  • Postgres
  • Postgres_fdw
  • Security
  • SQL Tuning
  • Temp Table

相關連結

  • 歐立威科技
  • 渡鴉之丘
  • EnterpriseDB
  • Postgresql

搜尋此網誌

熱門文章

  • Postgres 查找 Temp Table 建立者
  • PostgreSQL Windows psql 指令介面安裝與 UTF-8 編碼異常排解
  • PostgreSQL 查詢表格相依姓 ( Alter Table 語法 )
簡單主題. 技術提供:Blogger.