Local users are stored in
/etc/passwd. This file consists of one line per user; each line has fields that are separated with a colon. The first field contains the user name, the third field is the user ID.
I am not quite sure what a "regular user" is. I would say any user except root. root has user ID 0.
So, get all lines that have a value different than zero in the third field, and print their first field. Personally, I would use
awk for this. A combination of
grep and
cut should also cut it (pun intended).
The next question I have: What is an "aliasing command"? The shell has a command "alias" which allows creating a name for a string. For example:
creates an alias named
lsf. Whenever you type
lsf, the command
ls -F is executed.
So I guess you have to create an alias in the following way:
Code:
alias allmyusers="my awk command"