Is their any specific command to count of open files (nofile) by a user in linux?
Asked
Active
Viewed 1,014 times
1 Answers
1
lsof -u root | awk '{print $NF}' | sort | wc -l

Prabhakaran Ravichandran
- 182
- 4
-
You can drop the grep by using `lsof -u root`, and since you're only outputting a count (and not making it unique) the awk and sort are also unneeded. – Hasturkun Aug 16 '17 at 14:18