oOp*_*gEo 9 command-line display lightdm 14.04 who
I have a question that arose in my mind after upgrading to 14.04 TrustyTahr from 12.04 PrecisePangolin. The question pertains to the 'who' command, and its output. On previous editions of Ubuntu the output the who command would read what tty was used to login and initiate the system and lightdm, for example:
:~$ who
geo tty7 thedate (:0)
geo pts/n thedate (:0.0)
Run Code Online (Sandbox Code Playgroud)
But on 14.04 TrustyTahr, when I run the who command my output yields:
:~$ who
geo :0 thedate (:0)
geo pts/n thedate (:0.0)
Run Code Online (Sandbox Code Playgroud)
On both editions the vt7 handoff is happening in /boot, and on TrustyTahr my XDG_VTNR variable is 7 when I login via lightdm; but tty7, nor vt7 is printed to the utmp file. This annoyed me for months, I finally wrote a c++ program, that incorporates the popen function, as a supplement to the who command in order for the who command to display the current XDG_VTNR with a tty coefficient e.g.:
geo tty7 2015-06-04 20:54 (:0)
geo pts/0 2015-06-04 20:54 (:0.0)
Run Code Online (Sandbox Code Playgroud)
None the less why has this changed? And also is mine the only one like that, cause I downloaded this around May of last year, and I might have gotten a bunk iso or something, everytime I run the who command it makes me think of that Beastie Boys song: Sabotage (jk its not the bad).
小智 2
尝试升级包含该who命令的包;即使您确实使用了奇怪版本的 ISO 进行安装,更新也应该替换它:
找出包拥有什么who:
which who # find out where 'who' binary is
dpkg -S /path/to/who
Run Code Online (Sandbox Code Playgroud)
然后:
apt-get update
apt-get install <package name from dpkg -S command>
Run Code Online (Sandbox Code Playgroud)
如果仍然不起作用,请尝试使用没有环境的其他 shell(以消除任何不稳定的环境变量、设置、特定于 bash 的垃圾等):
env -i /bin/dash
$ who
Run Code Online (Sandbox Code Playgroud)
如果它在裸外壳中工作,那么问题可能是 bashrc 中奇怪的别名定义,或类似的东西。
还有,有who --all作用吗?
| 归档时间: |
|
| 查看次数: |
423 次 |
| 最近记录: |