You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

10 lines
322 B

import os
# open a pipe to "df ...", read from its stdout,
# strip the trailing \n, split it into a list on
# every \n, and put the results in 'data'
pipe = os.popen("df -Ph | " + "grep --color=never -E '^/dev' | " + "awk '{print $1, $2, $3, $4, $5, $6}'")
data = pipe.read().strip().split('/n')
pipe.close()
print data