ѧϰLinuxÏÂÁÔõÑùÉó²éÄ¿½ñÓû§Ãû³Æ
ÎÊÌ⣺LinuxÏÂÁî½Ì³Ì£ºÉó²éÄ¿½ñÓû§ÃûµÄÒªÁì
ÔÚLinuxϵͳÖУ¬ÏàʶĿ½ñµÇÈÎÃü»§ÃûÊǺÜÊÇÖ÷ÒªµÄ£¬¿ÉÒÔ×ÊÖúÓû§×¼È·µØÖ´ÐÐһЩ²Ù×÷ºÍÉó²éȨÏÞ¡£±¾ÆªÎÄÕ½«ÏÈÈÝÔõÑùʹÓÃLinuxÏÂÁîÀ´Éó²éÄ¿½ñÓû§ÃûµÄÒªÁ죬²¢ÌṩÏêϸµÄ´úÂëʾÀý×ÊÖú¶ÁÕ߸üºÃµØÃ÷È·¡£
ÔÚLinuxϵͳÖУ¬ÓÐÒ»¸öÌØÊâµÄÇéÐαäÁ¿½Ð×ö”USER”£¬ËüÉúÑÄÁËÄ¿½ñµÇÈÎÃü»§Ãû¡£Í¨¹ýÉó²éÕâ¸öÇéÐαäÁ¿£¬ÎÒÃǾÍÄܹ»»ñÈ¡Ä¿½ñÓû§ÃûµÄÐÅÏ¢¡£ÏÂÃæÊÇÔõÑùÔÚÖÕ¶ËÖÐʹÓÃÏÂÁîÀ´Éó²éÄ¿½ñÓû§ÃûµÄ´úÂëʾÀý£º
echo $USER
µÇ¼ºó¸´ÖÆ
ͨ¹ýÔÚÖÕ¶ËÖÐÊäÈëÉÏÊöÏÂÁϵͳ½«ÏÔʾĿ½ñµÇÈÎÃü»§µÄÓû§Ãû¡£Õâ¸öÒªÁìºÜÊǼòÆÓÖ±¹Û£¬ÊʺÏÓÚ¿ìËÙÉó²éÄ¿½ñÓû§ÃûµÄÇéÐΡ£
³ýÁËÉÏÊöÒªÁ죬ÎÒÃÇ»¹¿ÉÒÔͨ¹ýʹÓÔwhoami”ÏÂÁîÀ´Éó²éÄ¿½ñÓû§Ãû¡£”whoami”ÏÂÁî»á·µ»ØÄ¿½ñµÇÈÎÃü»§µÄÓû§Ãû£¬Ò²ÊÇÒ»ÖÖ³£ÓõÄÉó²éÄ¿½ñÓû§ÃûµÄÒªÁì¡£ÒÔÏÂÊÇʹÓÔwhoami”ÏÂÁîµÄ´úÂëʾÀý£º
whoami
µÇ¼ºó¸´ÖÆ
ÔÚÖÕ¶ËÖÐÊäÈëÉÏÊöÏÂÁϵͳ½«·µ»ØÄ¿½ñÄ¿½ñµÇÈÎÃü»§Ãû£¬×ÊÖúÓû§¿ìËÙ»ñÈ¡Ïà¹ØÐÅÏ¢¡£Í¨¹ýÕâÁ½ÖÖÒªÁ죬¶ÁÕß¿ÉÒÔ±ã½ÝµØÉó²éÄ¿½ñÓû§Ãû£¬Ìá¸ßÊÂÇéЧÂʺÍϵͳÖÎÀíµÄ±ãµ±ÐÔ¡£
×ܽáÀ´Ëµ£¬ÏàʶÔõÑùÉó²éÄ¿½ñÓû§ÃûÊÇLinuxϵͳÖлù´¡µÄ²Ù×÷Ö®Ò»¡£Í¨¹ý±¾ÎÄÏÈÈݵÄÁ½ÖÖÒªÁ죬¶ÁÕß¿ÉÒÔÇáËɵػñÊÊÄ¿½ñÓû§ÃûµÄÐÅÏ¢£¬ÎªÒ»Ñùƽ³£ÊÂÇéºÍϵͳÖÎÀíÌṩ±ãµ±¡£Ï£Íû±¾ÎÄÄܹ»×ÊÖú¶ÁÕßÔ½·¢ÊìÁ·µØʹÓÃLinuxϵͳ£¬²¢Ìá¸ßÊÂÇéЧÂÊ¡£
ÒÔÉϾÍÊÇѧϰLinuxÏÂÁÔõÑùÉó²éÄ¿½ñÓû§Ãû³ÆµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡