Skip to content

Commit f3041ae

Browse files
committed
Add commands
1 parent 27254d7 commit f3041ae

214 files changed

Lines changed: 18086 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/commands/Xnest.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# TLDR
2+
3+
**Start nested X server on display :1**
4+
5+
```Xnest :1```
6+
7+
**Start with specific window size**
8+
9+
```Xnest :1 -geometry [800x600]```
10+
11+
**Start with multiple screens**
12+
13+
```Xnest :1 -scrns [2]```
14+
15+
**Connect to specific parent display**
16+
17+
```Xnest :1 -display [:0]```
18+
19+
**Start fullscreen**
20+
21+
```Xnest :1 -fullscreen```
22+
23+
# SYNOPSIS
24+
25+
**Xnest** [:_display_] [_options_]
26+
27+
# PARAMETERS
28+
29+
**-display** _name_
30+
> Parent X server to connect to.
31+
32+
**-geometry** _WxH+X+Y_
33+
> Window geometry for nested server.
34+
35+
**-scrns** _num_
36+
> Number of screens to create.
37+
38+
**-depth** _n_
39+
> Default color depth.
40+
41+
**-fullscreen**
42+
> Run fullscreen on parent display.
43+
44+
**-bw** _n_
45+
> Border width in pixels.
46+
47+
**-name** _string_
48+
> Window name.
49+
50+
# DESCRIPTION
51+
52+
**Xnest** is a nested X server that runs as a window within another X server. It appears as a regular X client to the parent server while providing a complete X server environment to its own clients.
53+
54+
Applications connect to Xnest using its display number (e.g., :1) and receive a fully functional X environment. This enables testing window managers, running isolated X sessions, or displaying remote X applications in a contained window.
55+
56+
Xnest is resource-intensive since most requests pass through to the parent server. For better performance and modern extension support, Xephyr is recommended as a replacement.
57+
58+
# CAVEATS
59+
60+
Lacks modern X extensions (XRender, Composite, RandR). No hardware acceleration. Resource intensive. Xephyr is recommended for most use cases. Requires display number different from parent.
61+
62+
# HISTORY
63+
64+
**Xnest** was developed as a debugging and testing tool for X11. It enabled developers to test applications and window managers without risking their primary desktop. While still functional, the more capable Xephyr server has largely superseded it for modern use.
65+
66+
# SEE ALSO
67+
68+
[Xephyr](/man/Xephyr)(1), [Xvfb](/man/Xvfb)(1), [Xorg](/man/Xorg)(1), [startx](/man/startx)(1)

assets/commands/Xvfb.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# TLDR
2+
3+
**Start virtual display**
4+
5+
```Xvfb :99```
6+
7+
**Start with specific screen size**
8+
9+
```Xvfb :99 -screen 0 [1920x1080x24]```
10+
11+
**Start with multiple screens**
12+
13+
```Xvfb :1 -screen 0 [1280x1024x24] -screen 1 [800x600x16]```
14+
15+
**Use shared memory**
16+
17+
```Xvfb :99 -shmem -screen 0 [1024x768x24]```
18+
19+
**Store framebuffer in directory**
20+
21+
```Xvfb :99 -fbdir [/tmp/xvfb]```
22+
23+
**Run application with xvfb-run**
24+
25+
```xvfb-run -a [application]```
26+
27+
**xvfb-run with custom screen**
28+
29+
```xvfb-run -s "-screen 0 1280x1024x24" [application]```
30+
31+
# SYNOPSIS
32+
33+
**Xvfb** [:_display_] [_options_]
34+
35+
# PARAMETERS
36+
37+
**:display**
38+
> Display number (default: 0).
39+
40+
**-screen** _num_ _WxHxD_
41+
> Configure screen: number, width x height x depth.
42+
43+
**-pixdepths** _list_
44+
> Additional pixmap depths to support.
45+
46+
**-fbdir** _dir_
47+
> Directory for memory-mapped framebuffer files.
48+
49+
**-shmem**
50+
> Use shared memory for framebuffer.
51+
52+
**-linebias** _n_
53+
> Adjust line pixelization.
54+
55+
**-blackpixel** _value_
56+
> Set black pixel value.
57+
58+
**-whitepixel** _value_
59+
> Set white pixel value.
60+
61+
# XVFB-RUN OPTIONS
62+
63+
**-a**, **--auto-servernum**
64+
> Find available display number automatically.
65+
66+
**-s** _args_
67+
> Arguments to pass to Xvfb.
68+
69+
**-e** _file_
70+
> File to store Xvfb error output.
71+
72+
**-f** _file_
73+
> Authority file to use.
74+
75+
**-n** _num_
76+
> Server number to use.
77+
78+
# DESCRIPTION
79+
80+
**Xvfb** (X Virtual FrameBuffer) is an X server that performs all graphical operations in memory without any physical display. It implements the X11 protocol, allowing X applications to run without visible output.
81+
82+
Common use cases include running GUI applications on headless servers, automated testing of graphical applications, rendering graphics for web services, and CI/CD pipelines that require X applications.
83+
84+
The **xvfb-run** wrapper script simplifies usage by automatically selecting a display number and handling authentication.
85+
86+
Default screen configuration is 1280x1024x24 (width x height x depth in bits).
87+
88+
# CAVEATS
89+
90+
No GPU acceleration. Some applications may behave differently without real display. Memory usage scales with screen size and depth. Applications expecting specific display features may fail.
91+
92+
# HISTORY
93+
94+
**Xvfb** has been part of the X.Org server distribution since the X11R5 release. It was developed to enable X applications to run on systems without display hardware, supporting server-side rendering and automated testing long before headless browser technologies.
95+
96+
# SEE ALSO
97+
98+
[X](/man/X)(7), [Xserver](/man/Xserver)(1), [xvfb-run](/man/xvfb-run)(1), [xdpyinfo](/man/xdpyinfo)(1)

assets/commands/Xwayland.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# TLDR
2+
3+
**Start rootless** (typical usage by compositor)
4+
5+
```Xwayland :0 -rootless```
6+
7+
**Start rootful for testing**
8+
9+
```Xwayland :1 -geometry [1920x1080]```
10+
11+
**Start fullscreen rootful**
12+
13+
```Xwayland :1 -fullscreen```
14+
15+
**Start with decorations**
16+
17+
```Xwayland :1 -decorate```
18+
19+
**Force shared memory backend**
20+
21+
```Xwayland :0 -rootless -shm```
22+
23+
**Enable verbose output**
24+
25+
```Xwayland :0 -rootless -verbose [2]```
26+
27+
# SYNOPSIS
28+
29+
**Xwayland** [:_display_] [_options_]
30+
31+
# PARAMETERS
32+
33+
**-rootless**
34+
> Run rootless, integrating X clients with Wayland desktop.
35+
36+
**-fullscreen**
37+
> Run rootful window fullscreen.
38+
39+
**-geometry** _WxH_
40+
> Set rootful window geometry.
41+
42+
**-decorate**
43+
> Add decorations to rootful window.
44+
45+
**-output** _name_
46+
> Output for fullscreen rootful.
47+
48+
**-host-grab**
49+
> Disable host shortcuts, confine pointer (Ctrl+Shift to release).
50+
51+
**-shm**
52+
> Force shared memory backend.
53+
54+
**-glamor**
55+
> Force OpenGL rendering (not GL ES).
56+
57+
**-hidpi**
58+
> Adjust to output scale in rootful mode.
59+
60+
**-noTouchPointerEmulation**
61+
> Disable touch pointer emulation.
62+
63+
**-nokeymap**
64+
> Ignore compositor keymap.
65+
66+
**-listenfd** _fd_
67+
> Add listen socket (used by compositor).
68+
69+
**-wm** _fd_
70+
> Window manager socket (used by compositor).
71+
72+
**-verbose** _n_
73+
> Set verbosity level.
74+
75+
**-version**
76+
> Display version.
77+
78+
# DESCRIPTION
79+
80+
**Xwayland** is an X server that runs X11 applications under Wayland compositors. It translates X11 protocol to Wayland, enabling legacy X applications to work in modern Wayland desktops.
81+
82+
In rootless mode (default), X windows integrate seamlessly with Wayland windows, managed by the compositor. In rootful mode, Xwayland runs in its own window for testing or isolation.
83+
84+
Xwayland is typically spawned automatically by the Wayland compositor (GNOME, KDE Plasma, Sway, etc.) when X11 applications are launched.
85+
86+
Input, clipboard, and drag-and-drop are bridged between X11 and Wayland contexts.
87+
88+
# CAVEATS
89+
90+
Some X11-specific features may not work (screen capture, global hotkeys). Performance may be lower than native Wayland. Rootful mode is mainly for testing. HiDPI scaling requires compositor support.
91+
92+
# HISTORY
93+
94+
**Xwayland** was developed as part of the X.Org server project to enable X11 compatibility during the transition to Wayland. It became essential for running applications that haven't been ported to Wayland natively.
95+
96+
# SEE ALSO
97+
98+
[Xorg](/man/Xorg)(1), [Xserver](/man/Xserver)(1), [wayland](/man/wayland)(7), [sway](/man/sway)(1)

assets/commands/sadc.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# TLDR
2+
3+
Write **10 records** at one-second intervals to a binary file
4+
5+
```sadc 1 10 [/tmp/datafile]```
6+
7+
Write data to the **default daily data file** (/var/log/sa/saDD)
8+
9+
```sadc 1 10 -```
10+
11+
Collect **all available statistics** including disks and interrupts
12+
13+
```sadc -S ALL 1 10 [/tmp/datafile]```
14+
15+
Collect data with **disk and partition statistics**
16+
17+
```sadc -S XDISK 1 10 [/tmp/datafile]```
18+
19+
Add a **comment record** to the data file
20+
21+
```sadc -C "[system reboot]" [/var/log/sa/sa01]```
22+
23+
# SYNOPSIS
24+
25+
**sadc** [_-C comment_] [_-D_] [_-F_] [_-L_] [_-V_] [_-S {keyword,...}_] [_interval_] [_count_] [_outfile_]
26+
27+
# PARAMETERS
28+
29+
**-C** _comment_
30+
> Write a dummy record containing the specified comment string when interval and count are not specified
31+
32+
**-D**
33+
> Use saYYYYMMDD instead of saDD as the standard daily data file name
34+
35+
**-F**
36+
> Force creation of outfile; truncate if it exists with an incompatible format
37+
38+
**-L**
39+
> Try to get an exclusive lock on the outfile before writing or truncating
40+
41+
**-S** _keyword_
42+
> Specify optional activities to collect: INT (interrupts), DISK (block devices), XDISK (partitions/filesystems), SNMP, IPV6, POWER, ALL, XALL
43+
44+
**-V**
45+
> Print version number and exit
46+
47+
# DESCRIPTION
48+
49+
**sadc** (System Activity Data Collector) is the backend data collector for the **sar** command, part of the sysstat package. It samples system performance data at specified intervals and writes it in binary format to an output file.
50+
51+
The collector gathers metrics including CPU utilization, memory usage, I/O statistics, network activity, and process information. By default, it collects most kernel data except interrupts and disk statistics, which require explicit **-S** flags.
52+
53+
When outfile is set to **-**, sadc writes to the standard daily data file /var/log/sa/saDD. If count is omitted, sadc runs endlessly. The binary output is not human-readable and requires **sar** to interpret.
54+
55+
# CAVEATS
56+
57+
The **/proc** filesystem must be mounted for sadc to function. Available statistics depend on kernel version. sadc is typically invoked by the **sa1** script via cron rather than run directly. Output files from older sadc versions may be incompatible with newer releases.
58+
59+
# HISTORY
60+
61+
sadc is part of the **sysstat** package, originally written by Sebastien Godard. The sysstat tools evolved from earlier Unix system accounting utilities, with sadc providing the binary data collection layer that enables historical performance analysis through sar.
62+
63+
# SEE ALSO
64+
65+
[sar](/man/sar)(1), [iostat](/man/iostat)(1), [mpstat](/man/mpstat)(1), [vmstat](/man/vmstat)(8)

assets/commands/safe-rm.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# TLDR
2+
3+
**Delete a file** with protection against blacklisted paths
4+
5+
```safe-rm [path/to/file]```
6+
7+
**Recursively delete a directory** with protection checks
8+
9+
```safe-rm -r [path/to/directory]```
10+
11+
**Force delete files** while respecting protected paths
12+
13+
```safe-rm -rf [path/to/directory]```
14+
15+
**Delete multiple files** with verbose output
16+
17+
```safe-rm -v [file1] [file2] [file3]```
18+
19+
# SYNOPSIS
20+
21+
**safe-rm** [_rm options_] [_files_]
22+
23+
# PARAMETERS
24+
25+
safe-rm accepts all standard **rm** options and passes them through to the real rm command after verifying paths are not protected.
26+
27+
**-r**, **-R**, **--recursive**
28+
> Remove directories and their contents recursively
29+
30+
**-f**, **--force**
31+
> Ignore nonexistent files and arguments, never prompt
32+
33+
**-i**
34+
> Prompt before every removal
35+
36+
**-v**, **--verbose**
37+
> Explain what is being done
38+
39+
# DESCRIPTION
40+
41+
**safe-rm** is a wrapper around the rm command that prevents accidental deletion of important system files and directories. It checks arguments against a configurable blacklist before passing them to the real rm.
42+
43+
When a user attempts to delete a protected path, safe-rm refuses the operation and displays a warning instead. This provides a safety net against catastrophic mistakes like **rm -rf /**.
44+
45+
Protected paths are configured in **/etc/safe-rm.conf** for system-wide protection and **~/.safe-rm** for per-user settings. Each file contains one path per line. If both are empty, a default list of critical system paths is used.
46+
47+
To use safe-rm as the default rm, create a symlink in a directory that precedes /bin in your PATH:
48+
```ln -s /usr/bin/safe-rm /usr/local/bin/rm```
49+
50+
# CAVEATS
51+
52+
safe-rm cannot protect against all deletion patterns. While **rm -rf /usr/lib** is blocked if /usr/lib is protected, running **cd /usr/lib && rm -rf *** bypasses protection since the protected path itself is not an argument.
53+
54+
# HISTORY
55+
56+
safe-rm was created to prevent accidental deletion of critical system files. Version 1.0.0 released in **November 2020** was a complete rewrite in **Rust**, replacing the original implementation. The project is licensed under GPLv3.
57+
58+
# SEE ALSO
59+
60+
[rm](/man/rm)(1), [trash-cli](/man/trash-cli)(1), [shred](/man/shred)(1)

0 commit comments

Comments
 (0)