如何判断linux用户是否为root用户

看命令行提示符 ,如果是#,那就是root用户,如下图:
[root@localhost /]#
如果是$,那就是普通用户,如下图:
[test@localhost ~]$