Skip to content

Instantly share code, notes, and snippets.

@nad2000
Created June 10, 2013 03:20
Show Gist options
  • Save nad2000/5746324 to your computer and use it in GitHub Desktop.
Save nad2000/5746324 to your computer and use it in GitHub Desktop.
applications of sed and awk to analyze inodes
# total storage size held by processes:
lsof /data | grep postgres | grep deleted | awk '{ SUM += $7} END {print SUM}'
# processes that hold inodes:
lsof /data -u postgres | grep "(deleted)" | tr -s ' ' | cut -d ' ' -f2 | sort -u | xargs ps -u -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment