#!/usr/bin/python import os import re # No serious sh-fu df = os.popen("df -h /").readlines()[1] cols = re.split("\s+", df) print cols[3] + "/" + cols[1]