Software Knowledge

  1. Home
  2. Docs
  3. Software Knowledge
  4. LINUX
  5. LInux: How to check current open files handled by each process
Generic selectors
Exact matches only
Search in title
Search in content

LInux: How to check current open files handled by each process

lsof >/tmp/a.txt

awk ‘$3 == “oracle” {print $0}’ /tmp/a.txt |awk ‘{print $2}’|sort|uniq |while read AA

do

echo “$(date)  Process ID – $AA  —  Number of Open File =         $(awk -v aa=”$AA” ‘$2 == aa {print $9}’ /tmp/a.txt|sort|uniq|wc -l)”

done

#while :

#> do

#>     echo “$(date)  $(lsof -p 3745 |awk ‘{print $9}’|sort|uniq|wc -l)”

#>     sleep 60

#> done