Create an alias called whopw alian whopwypcat passwd grep w
Create an alias called whopw
alian whopw=\'ypcat passwd | grep `whoami`\'
Execute the alias. Is the output of the alias your entry from the ypcat passwd file?
Solution
Yes, the output of the alias will clearly shows only your entry from the ypcat passwd file.
There is an error in spelling for the alias in the given command, it is given as alian, I guess it should be alias.
Basically, here the alias whopw is a pipeline of two commands :
i) ypcat passwd
ii) grep `whoami`
The ypcat passwd command will list the networkwide password map. Thus all the users who used the network will be listed with this commad.
the grep `whoami` command will grep or searches and lists those lines where \'whoami\'(which gives the name of the currently logged-in user).
Thus the pipelined alias whopw will list only your entry in the networkwide password map.
