Quote:
Originally Posted by
sreyan32
I need only a single command to display the output of who and then add the total number of users and display at the bottom of that output.
There is no such
single command, because that would go against one of the most basic UNIX tenets: do
one and do it as good as possible. That means: there is a command to display the users logged in (
who, as you have already figured out) and it will do this displaying as good as possible - but it won't count, sort or do any other "after-processing" of its display. This is simply not its job. There is a
sort utility for sorting, but it will only do the
sorting - it will not generate output of its own. The same goes for line counting (see the
wc utility), filtering (see
grep,
sed,
awk and a lot of similar tools) and any other purpose.
Think of the UNIX tools like instrumentalists in an orchestra. You don't expect the trumpet player to play the flute as well. No, you have a world-class flutist to play the flute and a world-class trumpet player to play the trumpet. It is your job to conduct them accordingly to bring out the brilliant and stunning sound they are capable to produce.
I hope this helps.
bakunin