Skip to content

Instantly share code, notes, and snippets.

@santosh
Created February 22, 2013 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save santosh/5015849 to your computer and use it in GitHub Desktop.
Save santosh/5015849 to your computer and use it in GitHub Desktop.
Get current user's (the user who runs the script) full name (UNIX), as in finger command.
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import os
import pwd
print(pwd.getpwuid(os.getuid())[4])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment