Tell-me-more

I am pretty sure that you are wondering why such a title!

Tell-me-more is a command line tool built using Python3 that provides information about the linux user and the system. The tool displays the users of the system, the current user who is logged in the system, and the memory information.

To run the tool follow README .

I have used regex-regular expression in Python3 for pattern searching. I have taken help of re module for pattern searching, argparse module for taking command line argument.

Check the source code in github to stay updated.

Finds the users


def bash_users():
    with open('/etc/passwd', 'r') as fobj:
        f = fobj.readlines()
        pattern = '/bash'

        for i in f:
            m = re.search(pattern, i) #searches if the given pattern is in i
            if m:
                print("%s" % i.split(':')[4])
            else:
                pass


Finds details of the memory of your system



def memory_details():
    with open('/proc/meminfo', 'r') as fobj:
        f = fobj.readlines()
        pattern = '^Mem' #All the strings starting with Mem

        for i in f:
            m = re.search(pattern, i) #searches if the pattern is in i
            if m:
                print("%s: %d MB" % (i.split(':')[0], int(i.split()[1])/1024))  #Displays the memory in unit MB
            else:
                pass

See howitworks for a demo of Tell-me-more. Fork me on github to contribute for this project. Thank you 🙂