Linux系统下与终端相关的命令
生活随笔
收集整理的這篇文章主要介紹了
Linux系统下与终端相关的命令
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
文章目錄
- 一、命令 `who or w` 可以顯示有哪些終端登錄
- 二、命令 `who am i` 用來顯示當前終端是哪一個
- 三、命令 `tty` 顯示當前終端的設備文件
- 四、命令 `chvt` 用來切換虛擬終端
- 五、命令 `last` 顯示每個終端的登錄時間和持續時間等信息
- 六、命令 `toe -a` 列出系統支持的所有終端類型
- 七、命令infocmp來比較兩個終端的區別
一、命令 who or w 可以顯示有哪些終端登錄
[root@htlwk0001host ~]# w17:37:33 up 425 days, 7:35, 4 users, load average: 0.00, 0.01, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty1 - 238月20 153days 0.01s 0.01s -bash root pts/0 112.50.131.179 09:55 1.00s 0.02s 0.00s w root tty3 - 022月21 261days 0.48s 0.48s -bash root tty2 - 022月21 261days 0.01s 0.01s -bash [root@htlwk0001host ~]# who root tty1 2020-08-23 10:20 root pts/0 2021-10-22 09:55 (112.50.131.179) root tty3 2021-02-02 18:08 root tty2 2021-02-02 21:01二、命令 who am i 用來顯示當前終端是哪一個
[root@htlwk0001host ~]# who am i root pts/0 2021-10-22 09:55 (112.50.131.179)三、命令 tty 顯示當前終端的設備文件
[root@htlwk0001host ~]# tty /dev/pts/0注:終端都會被抽象成操作系統中的某個文件。
四、命令 chvt 用來切換虛擬終端
chvt 2 等同于 Ctrl + Alt + F2 快捷鍵,注意:在圖形界面不行。
五、命令 last 顯示每個終端的登錄時間和持續時間等信息
[root@htlwk0001host ~]# last root pts/0 112.50.131.179 Fri Oct 22 09:55 still logged in root pts/0 112.50.84.94 Thu Oct 21 13:47 - 20:33 (06:45) root pts/0 112.50.84.94 Tue Oct 19 15:59 - 22:00 (06:01) root pts/1 112.50.84.94 Sun Oct 17 11:26 - 23:43 (12:17) root pts/0 112.50.84.94 Sun Oct 17 10:56 - 23:43 (12:47) root pts/1 112.50.84.94 Sat Oct 16 15:10 - 23:21 (08:11) root pts/0 112.50.84.94 Sat Oct 16 15:03 - 23:23 (08:19) root pts/1 112.50.84.94 Fri Oct 15 10:54 - 00:04 (13:09) root pts/0 112.50.84.94 Fri Oct 15 08:18 - 21:17 (12:58)六、命令 toe -a 列出系統支持的所有終端類型
[root@htlwk0001host ~]# toe -a Eterm-256color Eterm with xterm 256-colors Eterm-88color Eterm with 88 colors Eterm Eterm with xterm-style color support (X Window System) ansi ansi/pc-term compatible with color aterm AfterStep terminal bterm bogl virtual terminal cygwin ANSI emulation for Cygwin cons25 freebsd console (25-line ansi mode) dumb 80-column dumb tty eterm gnu emacs term.el terminal emulation eterm-color Emacs term.el terminal emulator term-protocol-version 0.96 gnome GNOME Terminal gnome-256color GNOME Terminal with xterm 256-colors hurd The GNU Hurd console server konsole KDE console window konsole-256color KDE console window with xterm 256-colors kon Kanji ON Linux console linux linux console mach Mach Console mach-bold Mach Console with bold instead of underline mach-color Mach Console with ANSI color mach-gnu GNU Mach mach-gnu-color Mach Console with ANSI color mlterm multi lingual terminal emulator mrxvt multitabbed rxvt nsterm AppKit Terminal.app pcansi ibm-pc terminal programs claiming to be ansi putty PuTTY terminal emulator putty-256color PuTTY 0.58 with xterm 256-colors rxvt rxvt terminal emulator (X Window System) rxvt-16color rxvt with 16 colors like aixterm rxvt-256color rxvt 2.7.9 with xterm 256-colors rxvt-88color rxvt 2.7.9 with xterm 88-colors rxvt-basic rxvt terminal base (X Window System) rxvt-color rxvt terminal emulator (X Window System) rxvt-cygwin rxvt terminal emulator (X Window System) on cygwin rxvt-cygwin-native rxvt terminal emulator (native MS Window System port) on cygwin rxvt-unicode rxvt-unicode terminal (X Window System) rxvt-xpm rxvt terminal emulator (X Window System) screen VT 100/ANSI X3.64 virtual terminal screen-16color GNU Screen with 16 colors screen-256color GNU Screen with 256 colors screen.Eterm screen in Eterm screen.gnome screen in GNOME Terminal screen.konsole screen in KDE console window screen.konsole-256color GNU Screen with konsole using 256 colors screen.linux screen in linux console screen.mlterm screen in mlterm screen.mlterm-256color GNU Screen with mlterm using 256 colors screen.mrxvt screen in mrxvt screen.putty screen in putty screen.putty-256color GNU Screen with putty using 256 colors screen.rxvt screen in rxvt screen.teraterm disable ncv in teraterm screen.vte screen in any VTE-based terminal screen.vte-256color GNU Screen with vte using 256 colors screen.xterm-256color GNU Screen with xterm using 256 colors screen.xterm-r6 screen customized for X11R6 xterm screen.xterm-xfree86 screen customized for modern xterm st simpleterm st-16color simpleterm with 16-colors st-256color simpleterm with 256 colors sun Sun Microsystems Inc. workstation console teraterm Tera Term teraterm2.3 Tera Term Pro tmux tmux terminal multiplexer tmux-256color tmux with 256 colors vt100-nav vt100 without advanced video option vt102 dec vt102 vt52 dec vt52 vte VTE aka GNOME Terminal vte-256color VTE with xterm 256-colors vwmterm (vwm term) vt100 dec vt100 (w/advanced video) vt220 dec vt220 wsvt25 NetBSD wscons in 25 line DEC VT220 mode wsvt25m NetBSD wscons in 25 line DEC VT220 mode with Meta xfce Xfce Terminal xterm xterm terminal emulator (X Window System) xterm-1002 xterm any-event mouse xterm-1003 testing xterm-mouse xterm-1005 xterm UTF-8 mouse xterm-1006 xterm SGR-mouse xterm-16color xterm with 16 colors like aixterm xterm-256color xterm with 256 colors xterm-88color xterm with 88 colors xterm-8bit xterm terminal emulator 8-bit controls (X Window System) xterm-basic modern xterm terminal emulator - common xterm-bold xterm terminal emulator (X11R6 Window System) standout w/bold xterm-direct xterm with direct-color indexing xterm-direct2 xterm with direct-color indexing (old) xterm-hp xterm with hpterm function keys xterm-new modern xterm terminal emulator xterm-nic xterm with ich/ich1 suppressed for non-curses programs xterm-noapp xterm with cursor keys in normal mode xterm-old antique xterm version xterm-pcolor xterm with color used for highlights and status line xterm-r5 xterm R5 version xterm-r6 xterm X11R6 version xterm-sco xterm with SCO function keys xterm-sun xterm with sunFunctionKeys true xterm-utf8 xterm with no VT100 line-drawing in UTF-8 mode xterm-vt220 xterm emulating vt220 xterm-vt52 xterm emulating dec vt52 xterm-x10mouse X10 xterm mouse xterm-x11hilite X11 mouse with highlight xterm-x11mouse X11 mouse xterm-xf86-v32 xterm terminal emulator (XFree86 3.2 Window System) xterm-xf86-v33 xterm terminal emulator (XFree86 3.3 Window System) xterm-xf86-v333 xterm terminal emulator (XFree86 3.3.3 Window System) xterm-xf86-v40 xterm terminal emulator (XFree86 4.0 Window System) xterm-xf86-v43 xterm terminal emulator (XFree86 4.3 Window System) xterm-xf86-v44 xterm terminal emulator (XFree86 4.4 Window System) xterm-xfree86 xterm terminal emulator (XFree86) xterm-xi xterm on XI Graphics Accelerated X under BSD/OS 3.1 xterm-color generic color xterm xterm-24 xterm terminal emulator (X Window System)七、命令infocmp來比較兩個終端的區別
比如 infocmp vt100 vt220 將會輸出 vt100 和 vt220 的區別:
[root@htlwk0001host ~]# infocmp vt100 vt220 comparing vt100 to vt220.comparing booleans.mir: F:T.comparing numbers.comparing strings.blink: '\E[5m$<2>', '\E[5m'.bold: '\E[1m$<2>', '\E[1m'.clear: '\E[H\E[J$<50>', '\E[H\E[J'.cuf1: '\E[C$<2>', '\E[C'.cup: '\E[%i%p1%d;%p2%dH$<5>', '\E[%i%p1%d;%p2%dH'.cuu1: '\E[A$<2>', '\E[A'.dch: NULL, '\E[%p1%dP'.dch1: NULL, '\E[P'.dl: NULL, '\E[%p1%dM'.dl1: NULL, '\E[M'....總結
以上是生活随笔為你收集整理的Linux系统下与终端相关的命令的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 改装大包围可以备案吗(改装大包围可以备案
- 下一篇: linux的防火墙(linux 的防火墙