Find all mount points in the file system. : System Cmd Mount : System PYTHON examples


PYTHON examples » System » System Cmd Mount »

 

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


           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo System
» System Cmd Mount


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0