At some point during the weekend, I needed to pull a list of existing users on my Linux server. While I expected this to be a trivial task, it took me sometime to come up with the solution.
Part of the problem, ironically, is that it is easy to do but done in an unexpected way. Basically, you accomplish it via the passwd file.
Simply execute the following (on the console, as this is a server and I wouldn’t expect it to have a GUI).
I originally pulled this information from: http://www.linuxquestions.org/questions/linux-software-2/get-a-list-of-linux-users-179102/
Note: I didn’t definitively explore all of the possible ways one could accomplish this. Once I found this method that effectively gave me the information I was after, I quit looking. If you have additional methods, please post a comment below and I will work it in to the article citing you (and linking to your site) as the source. I would truly appreciate any and all additional methods — even if specific to a distribution.
One of the most difficult aspects of starting to use Linux– a server distribution in particular — is remembering all of the different command line programs that exist in order to aid your work.
Obviously, man is a great reference but that is actually difficult to use when getting started as it itself is a command line program. I was searching for a command to list all of the users on a system (I found it and will post a brief article on that soon) and I stumbled across this, so I wanted to share it (as well as retain it for future reference.)
http://www.reallylinux.com/docs/admin.shtml
This covers such things as:
- Networking information / status (
arp, ifconfig, netstat, etc)
- File system information (
df)
- Disk Size / utilization information (
du)
- How to search for files with
find
- Easy-to-use console text editors (
nano, joe)
- Process management / information (
ps, top)
In addition to listing the commands, it lists common usage scenarios and command line flags of note.
A bit ago now, I introduced the tOSU-WebServer which is a web server for educational purposes. As explained in my other writings that web server is simple and is not suitable for production use, though it could be modified and improved for that purpose.
I was flipping though Linux magazines and came across the Linux Journal’s article on Mongoose. Mongoose is an open source, self contained web server written in C and implemented in two files.
It is significantly more difficult to understand than tOSU-WebServer, but it has a lot more features. Also, the fact that it’s written in C (as is Apache 2) might be appealing to some. I hope to explore it’s API a bit but I’m not sure I’ll do any formal articles on it. If you can follow the implementation details of tOSU-WebServer, you should be able to orientate yourself on Mongoose (assuming you are familiar with C).
The source code repository and project information are located on Google code: http://code.google.com/p/mongoose/
As some readers will know, I’ve been working to study the architecture of FireFox. One thing I realize is that I’m not as familiar as I should be with some of the common open source tools, or what I consider to be the common open source tools.
Below is a list of tools that are worth learning (in my opinion). I’ve also included a short description of why it might be worth learning them. (The list is in no particular order)
If you have an interest in open source, it will not hurt to get a quick base understanding of each of these. I’m not saying you (nor am I trying to) become an expert in each of these tools. However, having a basic understanding of syntax and function should save time and headache while trying to understand a project.
- Linux: The concepts in and around Linux are often used on other open source products. I think Open Source developers tend to stick with using open source software. So, there is a link there.
- Bash: The de-facto standard shell for Linux (as far as I can tell). Knowing the basic usage of bash can save you time and confusion. Certain scripts can depend on feature of your terminal interface. The Mac OS X ships with a version of bash, which is good to know…
- GCC: This is the GNU Compiler Collection and is often a requirement to build open source packages.
- Make: This is a part of the GCC but I want to make special mention of this because knowing how to read the script files and error messages can help diagnose an error.
- C / C++: Low Level libraries are often written in C or C++, even for an otherwise Java or Python based program.
- Python: Python is sometimes used in conjunction with Make to check for build dependencies, verify (build) requirements, or many other possible things.
- Perl: Often used like Python, from what I understand but I’ve yet to learn much about it.
- Subversion: This is the most common open source VCS software in use (based on my own observations)
- Mercurial: One of the two popular DVCS systems. I’ve noticed more and more open source projects switching to DVCSs, so a basic working knowledge of Mercurial and Git is helpful.
- git: The second of the two popular DVCS systems.
If you’d like to contribute to the list, please leave a comment below but please ensure you include a fair reason.
Categories: FireFox, Open Source Project, Technologies, Understanding Software Tags: Bash, DVCS, FireFox, GCC, git, GNU, Linux, Mac OS, Mercurial, Open Source, Open Source Software, Perl, Python, Tool
Recent Comments