Unix with the Bash shell is beautiful because you can string a list of simple commands together to instruct computers to do complex things. Folks sometimes refer to this as “sed, grep, awk”. Those are Unix commands with cryptic names – they sound like mysterious incantations of wizardry. And in effect they are.
Here are some examples:
1. What users are on this box?
The /etc/passwd file contains a list of all users the box. To see the last 5 people added to system you can type:
$ cat /etc/passwd | tail – 5
The dollar sign is the prompt (you don’t type that)
the cat command lists out the contents of a file.
Piping that (|) into tail -5 lists the last 5 rows.
The results may look like this:
This shows name, x, user id, group id, description, home directory and default shell for each user. x is a place holder for the password.