startx命令来自于英文词组”start X-windows“的缩写,其功能是用于启动X-Windows系统。X-Windows System也被称为X或X11,中文译为X窗口系统,主要工作就是以图形方式显示软件窗口的系统,现在的GNOME和KDE桌面环境都是以X窗口系统为基础构建成的。
语法格式:startx [参数]
| 参数 | 功能 |
|---|---|
| -m | 当未找到启动脚本时,启动窗口管理器 |
| -r | 当未找到启动脚本时,装入资源文件 |
| -w | 强制启动 |
| -x | 使用startup脚本启动X-windows会话 |
以默认方式初始化启动X窗口系统
[root@monster ~]# startx xauth: file /root/.serverauth.21712 does not exist X.Org X Server 1.20.3 X Protocol Version 11, Revision 0 Build Operating System: 4.14.0-49.el7a.noaead.x86_64 Current Operating System: Linux monster.com 4.18.0-80.el8.x86_64 #1 SMP Wed Mar 13 12:02:46 UTC 2019 x86_64 Kernel command line: BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-80.el8.x86_64 root=/dev/mapper/rhel-root ro resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet Build Date: 22 February 2019 07:47:26PM Build ID: xorg-x11-server 1.20.3-5.el8 Current version of pixman: 0.36.0 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.2.log", Time: Sat May 14 04:48:44 2022 (==) Using config directory: "/etc/X11/xorg.conf.d" (==) Using system config directory "/usr/share/X11/xorg.conf.d" VMware: No 3D enabled (0, Success). (II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
强制启动X窗口系统
[root@monster ~]# startx -w xauth: file /root/.serverauth.22325 does not exist X.Org X Server 1.20.3 X Protocol Version 11, Revision 0 Build Operating System: 4.14.0-49.el7a.noaead.x86_64 Current Operating System: Linux monster.com 4.18.0-80.el8.x86_64 #1 SMP Wed Mar 13 12:02:46 UTC 2019 x86_64 Kernel command line: BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-80.el8.x86_64 root=/dev/mapper/rhel-root ro resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet Build Date: 22 February 2019 07:47:26PM Build ID: xorg-x11-server 1.20.3-5.el8 Current version of pixman: 0.36.0 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.2.log", Time: Sat May 14 04:54:16 2022 (==) Using config directory: "/etc/X11/xorg.conf.d" (==) Using system config directory "/usr/share/X11/xorg.conf.d" VMware: No 3D enabled (0, Success). (II) modeset(0): Initializing kms color map for depth 24, 8 bpc. xinit: Unable to run program "xterm": No such file or directory Specify a program on the command line or make sure that /usr/bin is in your path. xinit: connection to X server lost waiting for X server to shut down (II) Server terminated successfully (0). Closing log file. [root@monster ~]#uname命令
uname命令来自于英文词组”Unix name“的缩写,其功能是用于查看系统主机名、内核及硬件架构等信息。如果不加任何参数,默认仅显示系统内核名称,相当于-s参数。
语法格式:uname [参数]
| 参数 | 功能 |
|---|---|
| -a | 显示系统所有相关信息 |
| -m | 显示计算机硬件架构 |
| -n | 显示主机名称 |
| -r | 显示内核发行版本号 |
| -s | 显示内核名称 |
| -v | 显示内核版本 |
| -p | 显示主机处理器类型 |
| -o | 显示操作系统名称 |
| -i | 显示硬件平台 |
显示系统内核名称
[root@monster ~]# uname Linux [root@monster ~]#
显示系统所有相关信息
[root@monster ~]# uname -a Linux monster.com 4.18.0-80.el8.x86_64 #1 SMP Wed Mar 13 12:02:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux [root@monster ~]#
显示系统内核版本号
[root@monster ~]# uname -r 4.18.0-80.el8.x86_64 [root@monster ~]#
系统硬件架构
[root@monster ~]# uname -i x86_64 [root@monster ~]#



