Linux command
sx 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start an X session
sx
Start an X session
sx [dwm]
Start an X session
sx [exec] [i3]
Run
sx [xterm]
说明
sx is a small POSIX shell script that starts an Xorg server, sets up an authority cookie, and then runs a user-supplied command (or _sxrc_) as the X session. It is intended as a minimal, transparent replacement for xinit and startx, exposing the same basic mechanics without their many optional behaviors. The X server is started on the same TTY where sx is invoked, with the display number derived from the TTY number (so VT1 becomes _:1_). A fresh MIT-MAGIC-COOKIE-1 is generated from _/dev/urandom_ and registered with xauth before the server is launched with -keeptty -noreset. If no arguments are passed, sx runs the executable file at _$XDG_CONFIG_HOME/sx/sxrc_ (defaulting to _~/.config/sx/sxrc_). Otherwise the supplied command and its arguments become the session leader: when it exits, sx tears down the server.
FAQ
What is the sx command used for?
sx is a small POSIX shell script that starts an Xorg server, sets up an authority cookie, and then runs a user-supplied command (or _sxrc_) as the X session. It is intended as a minimal, transparent replacement for xinit and startx, exposing the same basic mechanics without their many optional behaviors. The X server is started on the same TTY where sx is invoked, with the display number derived from the TTY number (so VT1 becomes _:1_). A fresh MIT-MAGIC-COOKIE-1 is generated from _/dev/urandom_ and registered with xauth before the server is launched with -keeptty -noreset. If no arguments are passed, sx runs the executable file at _$XDG_CONFIG_HOME/sx/sxrc_ (defaulting to _~/.config/sx/sxrc_). Otherwise the supplied command and its arguments become the session leader: when it exits, sx tears down the server.
How do I run a basic sx example?
Run `sx` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more sx examples?
This page includes 4 examples for sx, plus related commands for nearby Linux tasks.