linux的tty模式怎么用,Linux下的tty的使用

1.查看机器目前所有的在运行的TTY

[root@localhost ~]# w

05:49:15 up 23 min, 3 users, load average: 0.00, 0.04, 0.08

USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

root tty1 05:26 12:35 0.17s 0.17s -bash

root tty2 05:38 2:51 0.03s 0.03s -bash

root pts/0 05:48 3.00s 0.07s 0.03s w

w 可以显示从哪个远程端登录

[root@localhost ~]# who

root tty1 2019-01-05 05:26

root tty2 2019-01-05 05:38

root pts/0 2019-01-05 05:48

who显示的只有用户名和登录时间

2.如何查看当前的使用的TTY

[root@localhost ~]# who am i

root pts/0 2019-01-05 05:48

pts指的是虚拟终端

或者

[root@localhost ~]# tty

/dev/pts/0

3.切换TTY及TTY之间通信

切换 <1> CTRL+ALT+F1~F6

F1~F6分别为tty1 ~tty6

<2> sudo chvt 1

数字代表tty1

通信

echo “hello word” > /dev/tty1

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值