Find all mount points in the file system. : System Cmd Mount « System « Python






Find all mount points in the file system.

Find all mount points in the file system.
# execute the external "mount" command and parse the output.

import commands
 
mount = commands.getoutput('mount -v')
lines = mount.split('\n')
points = map(lambda line: line.split()[2], lines)
 
print points


           
       








Related examples in the same category

1.Use lambda function to find all mount points in our file system.Use lambda function to find all mount points in our file system.
2.Construct lists from other lists. Construct lists from other lists.