Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the startx command in Linux

Shulou Source: shulou.com Published: 2022-06-01 17:59:12 09月30日 Update

Editor to share with you how to use the startx command in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Linux commonly used command startx command is used to start X Window, in fact, the program that starts X Window is xinit.

Startx is used to start X Window

Syntax startx (parameters) parameters client and options: X client and options

Server and options: X server and options.

To start an X session on a workstation or on an X terminal, enter:

Startx to force an X session to start on a workstation, enter:

Startx-w to start an X session for the X terminal and log out of the user's telnet session, enter:

Startx; kill-9$ to start an X session using the .xinitrc script, enter:

Startx-x .xinitrc to start an X session using the mwm window manager, enter:

Startx-m mwm however, if the startup script file is found, the-w option is ignored. In the startup script, it is the user's responsibility to start the window manager, load X resources, and generate X clients. The following is an example of an .xsession script.

#! / bin/csh (mwm &) xrdb-load .Xdefaults (xclock-g 75x75+0+0 &) (xbiff-g 75x75+101-0 &) if ("/ dev/lft*" = = "`tty`") then aixterm-g 80x24+0+0 + ut-C-T `hostname` else aixterm-g 80x24+0+0 + ut-T `hostname` endif for workstations, the last line in the startup script should be the foreground aixterm command with the-C option to indicate console information. For X terminals, the last line in the startup script should be the foreground aixterm command without the-C option. In addition, because some X terminals do not terminate the telnet session when closed, the user must exit the current telnet session before using the hotkey to switch to the X session.

The xdm command in the / usr/lib/X11/xdm/Xsession file can also use the startx command. This provides the function of the startx command for the xdm command.

The following is the file name that is always used to start an X session.

$HOME/.xerrors, where startx is used to redirect error messages. By default, startx redirects the error to the .x errors file in the user's home directory. $HOME/.Xinit, $HOME/.xinit, $HOME/.Xinitrc, $HOME/.xinitrc, $HOME/.xsession start the window manager, load X resources, and generate X clients as "startup files" containing the shell command. $HOME/.Xdefaults, $HOME/.xresources as the loaded X resource file to set the user preferences for the X client. $HOME/.mwmrc mwm profile. $HOME/.twmrc twm profile. $HOME/.awmrc awm profile. $HOME/.uwmrc uwm profile. The interface of / dev/lft* terminal or tty, workstation initial login shell. The above is all the contents of the article "how to use startx commands in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Commands files scripts clients terminals inputs users jobs configurations clients articles resources management one line content foreground parameters clients workstations servers Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Redmi macOS Microsoft MariaDB