为什么发出相同的命令可以在tty中创建比在pts / gnome-terminal中更多的输出?


11

gnome终端:

$ sudo update-grub
[sudo] password for user: 
Generating grub configuration file ...
Found background image: .background_cache.png
Found linux image: /boot/vmlinuz-3.16.0-4-amd64
Found initrd image: /boot/initrd.img-3.16.0-4-amd64
done

tty1由Ctrl+ Alt+ 访问F1

$ sudo update-grub
[sudo] password for user: 
Generating grub configuration file ...
Found background image: .background_cache.png
Found linux image: /boot/vmlinuz-3.16.0-4-amd64
Found initrd image: /boot/initrd.img-3.16.0-4-amd64
[ 1603.545926] EXT4-fs (sda2): unable to read superblock
... (repeats twice)
[ 1603.560671] FAT-fs (sda2): invalid media value (0x4c)
... (repeats once)
[ 1603.573245] qnx4: no qnx4 filesystem (no root dir).
done

在尝试重定向tty1的输出以便能够直接将其复制到此处时,我注意到这些附加行不是来自命令的stdout或stderr。从哪里开始?为什么?


5
您可能会注意到,当您在gnome终端中运行命令时,这些行仍会出现在tty1上。
Random832 '16

Answers:


20

它们来自内核。您还将通过运行看到它们

dmesg

默认情况下,内核消息显示在虚拟控制台上。它们不在X终端仿真器(例如GNOME终端)中。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.