How can I get user information on Ubuntu

I want to get user information like room number and work phone in a bash script or c program. How can I do that?

Answers


You can get a struct passwd using getpwent or getpwnam or such. Then, you can parse the pw_gecos field.


Need Your Help

Use Grunt to make DOM changes

image responsive-design attributes gruntjs

So I want to use Lazysizes (lazy loading responsive images). Included in my Grunt stack is Responsive Images Extender, which outputs responsive image code (srcset) from simply including an "img" ta...

How do I stop the Sun JDK1.6 builtin StAX parser from resolving DTD entities

java xml parsing stax

I'm using the StAX event based API's to modify an XML stream. The stream represents an HTML document, complete with DTD declaration. I would like to copy this DTD declaration into the output document

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.