Shell获取当前用户

id | sed -e 's/).*//g' -e 's/.*(//'

比$LOGNAME $NAME who am i都要准确一些

原文地址:https://www.cnblogs.com/tuzkee/p/3490340.html