linux查找符号文件以及其映射

#! /usr/bin/env python

import os
import re

result = os.popen('ls -l /usr/bin')
contents = result.readlines()
for line in contents:
    match = re.match(r'.*\s+(.*?)\s+->\s+(.*)', line.strip())
    if match is not None:
        print match.group(1),'->',match.group(2)


你可能感兴趣的:(linux)