go run main.gopx aux | grep main.go- Grab pid from ^
pgrep -P [pid]- Grab child pid from ^
lsof -p [pid]- Sort it:
lsof -p [pid] | sort -n -r -k7 rm output.txt- Watch the file count continue to go up from previous step because the file descriptor is still open.
Sort all file handlers by size:
lsof | sort -n -r -k7 | head -10