Kernel

File Handles

List file handles for a certain pid:

ls -la /proc/$pid/fd

Here is why closing file handles in Python is important:

python -c "
files = [open('/tmp/fd_example_open_%d' % i) for i in range(20)]
import os
print 'Look at all those file handles noone uses! :D'
print 'ls -la /proc/%d/fd' % os.getpid()
raw_input('Press a key to continue. ')
"