#!/usr/bin/python import commands enabled = commands.getoutput('find /etc/apt -name *.list -exec grep -v "^#" {} \ ; | grep -v "^$"') disabled = commands.getoutput('find /etc/apt -name *.list -exec grep "^#" {} \; | grep -Ev "^#\W*$"') print "Enabled Repositories \n\n" + enabled print "\n\nDisabled Repositories \n\n" + disabled