Skip to content

Commit e56bf53

Browse files
committed
Add commands
1 parent 31f5d0e commit e56bf53

19 files changed

Lines changed: 1127 additions & 3 deletions

assets/commands/apptainer-cache.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# TAGLINE
2+
3+
Manage the local Apptainer container cache
4+
5+
# TLDR
6+
7+
**List all cached images**
8+
9+
```apptainer cache list```
10+
11+
**List cached images with details**
12+
13+
```apptainer cache list -v```
14+
15+
**List only OCI cached images**
16+
17+
```apptainer cache list -T oci```
18+
19+
**Clean all cached images**
20+
21+
```apptainer cache clean```
22+
23+
**Clean cache without confirmation**
24+
25+
```apptainer cache clean -f```
26+
27+
**Clean cache entries older than 30 days**
28+
29+
```apptainer cache clean -D 30```
30+
31+
**Dry run to see what would be cleaned**
32+
33+
```apptainer cache clean -n```
34+
35+
# SYNOPSIS
36+
37+
**apptainer cache** [_subcommand_] [_options_]
38+
39+
# DESCRIPTION
40+
41+
**apptainer cache** manages the local Apptainer container image cache. When pulling or building containers, Apptainer stores intermediate images and layers locally to speed up subsequent operations. This command allows listing cache contents and cleaning up disk space.
42+
43+
The cache is stored at **$HOME/.apptainer/cache** by default, or at the path specified by the **APPTAINER_CACHEDIR** environment variable.
44+
45+
# SUBCOMMANDS
46+
47+
**list**
48+
> Display the contents of the local cache, showing size and type of cached images
49+
50+
**clean**
51+
> Remove items from the local cache to reclaim disk space
52+
53+
# PARAMETERS
54+
55+
**-T, --type** _strings_
56+
> Limit operation to specific cache types: **library**, **oci**, **shub**, **blob**, **net**, **oras**, **all** (default: all)
57+
58+
**-v, --verbose**
59+
> Display detailed information about cached images (list only)
60+
61+
**-D, --days** _int_
62+
> Remove cache entries older than the specified number of days (clean only)
63+
64+
**-n, --dry-run**
65+
> Show what would be deleted without actually removing anything (clean only)
66+
67+
**-f, --force**
68+
> Suppress confirmation prompts and clean immediately (clean only)
69+
70+
# CAVEATS
71+
72+
Large builds and frequent pulls can consume significant disk space in the cache directory. The cache is per-user and does not affect other users on the system. Cleaning the cache forces re-download of images on next use.
73+
74+
# SEE ALSO
75+
76+
[apptainer](/man/apptainer)(1), [apptainer-build](/man/apptainer-build)(1), [apptainer-pull](/man/apptainer-pull)(1)

assets/commands/autoload.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# TAGLINE
2+
3+
Autoload shell functions for lazy loading
4+
5+
# TLDR
6+
7+
**Autoload a function** by name
8+
9+
```autoload [function_name]```
10+
11+
**Autoload with immediate undefined-function handling** (zsh)
12+
13+
```autoload -U [function_name]```
14+
15+
**Autoload with zsh-style function initialization** (suppresses alias expansion)
16+
17+
```autoload -Uz [function_name]```
18+
19+
**Autoload all functions** in a directory added to fpath
20+
21+
```autoload -Uz $fpath[1]/*(.:t)```
22+
23+
**Autoload the completion system**
24+
25+
```autoload -Uz compinit && compinit```
26+
27+
**Autoload the prompt system**
28+
29+
```autoload -Uz promptinit && promptinit```
30+
31+
# SYNOPSIS
32+
33+
**autoload** [_-UXmtz_] [_name ..._]
34+
35+
# PARAMETERS
36+
37+
**-U**
38+
> Suppress alias expansion when the function is loaded
39+
40+
**-z**
41+
> Use zsh-style function definitions (default in zsh)
42+
43+
**-k**
44+
> Use ksh-style function definitions
45+
46+
**-X**
47+
> Immediately load and execute the function (used inside the function itself)
48+
49+
**-t**
50+
> Enable execution tracing for the autoloaded function
51+
52+
**-m**
53+
> Treat arguments as patterns for matching function names
54+
55+
**+X**
56+
> Force the function to be loaded immediately without executing it
57+
58+
# DESCRIPTION
59+
60+
**autoload** marks shell function names for deferred loading. Instead of reading a function definition into memory at startup, the shell records only the function name. When the function is first called, the shell searches the directories listed in **$fpath** for a file matching the function name, reads its definition, and executes it.
61+
62+
This mechanism significantly reduces shell startup time when many functions are available but rarely used. The function file should contain the function body directly (not wrapped in a `function name { }` block for zsh-style autoloading).
63+
64+
**autoload** is essential for zsh's completion system (**compinit**), prompt themes (**promptinit**), and many other standard functions distributed with zsh.
65+
66+
# CAVEATS
67+
68+
The function file must be in a directory listed in **$fpath**. The file name must exactly match the function name. Functions autoloaded with **-U** will not have aliases expanded in their definitions, which is strongly recommended to avoid unexpected behavior. Only available as a shell builtin in zsh and ksh.
69+
70+
# HISTORY
71+
72+
**autoload** originates from **ksh** (Korn Shell), designed by **David Korn** at Bell Labs in the **1980s**. Zsh adopted and extended the concept, making it central to its modular function system. The **-U** and **-z** flags are zsh-specific additions.
73+
74+
# SEE ALSO
75+
76+
[zsh](/man/zsh)(1), [source](/man/source)(1), [compinit](/man/compinit)(1)

assets/commands/bye.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# TAGLINE
2+
3+
Exit the shell
4+
5+
# TLDR
6+
7+
**Exit the current shell** session
8+
9+
```bye```
10+
11+
**Exit with a specific status** code
12+
13+
```bye [exit_code]```
14+
15+
# SYNOPSIS
16+
17+
**bye** [_n_]
18+
19+
# DESCRIPTION
20+
21+
**bye** is a zsh builtin that terminates the current shell session. It is functionally identical to **exit**. When called, it runs any **EXIT** traps and zshexit hooks before closing the shell.
22+
23+
If an optional numeric argument is provided, it is used as the exit status returned to the parent process. Without an argument, the exit status of the last command executed is used.
24+
25+
# CAVEATS
26+
27+
**bye** is specific to zsh and not available in bash or other shells. For portability, use **exit** instead. If there are running background jobs, zsh may warn before exiting on the first attempt.
28+
29+
# HISTORY
30+
31+
**bye** was included in **zsh** as a convenience alias for **exit**, reflecting a common command used in interactive systems like FTP clients and some early Unix shells.
32+
33+
# SEE ALSO
34+
35+
[exit](/man/exit)(1), [logout](/man/logout)(1), [zsh](/man/zsh)(1)

assets/commands/chdir.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# TAGLINE
2+
3+
Change the current working directory
4+
5+
# TLDR
6+
7+
**Change to a specific directory**
8+
9+
```chdir [path/to/directory]```
10+
11+
**Change to home directory**
12+
13+
```chdir ~```
14+
15+
**Change to parent directory**
16+
17+
```chdir ..```
18+
19+
**Change to previous directory**
20+
21+
```chdir -```
22+
23+
# SYNOPSIS
24+
25+
**chdir** [_directory_]
26+
27+
# DESCRIPTION
28+
29+
**chdir** changes the current working directory of the shell to the specified path. It is functionally equivalent to **cd** and available as a builtin in zsh, csh, and tcsh.
30+
31+
When called without arguments, it changes to the user's home directory. The **CDPATH** variable is searched if the specified directory is not found relative to the current directory.
32+
33+
# CAVEATS
34+
35+
**chdir** is not available in bash (use **cd** instead). For portable scripts, always use **cd**. The command is a shell builtin and does not exist as a standalone executable.
36+
37+
# HISTORY
38+
39+
**chdir** is the original name of the directory-changing system call in **Unix**, dating back to the **First Edition** in **1971**. The **cd** command was introduced as a shorter alias. Shells like **csh** (1978) and later **zsh** retained **chdir** as a builtin alongside **cd**.
40+
41+
# SEE ALSO
42+
43+
[cd](/man/cd)(1), [pushd](/man/pushd)(1), [popd](/man/popd)(1), [pwd](/man/pwd)(1)

assets/commands/disable.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# TAGLINE
2+
3+
Disable shell builtins or other named elements
4+
5+
# TLDR
6+
7+
**Disable a shell builtin**
8+
9+
```disable [builtin_name]```
10+
11+
**Disable a shell function**
12+
13+
```disable -f [function_name]```
14+
15+
**Disable a reserved word**
16+
17+
```disable -r [reserved_word]```
18+
19+
**List all disabled builtins**
20+
21+
```disable```
22+
23+
**Re-enable a disabled builtin**
24+
25+
```enable [builtin_name]```
26+
27+
# SYNOPSIS
28+
29+
**disable** [_-afmprs_] [_name ..._]
30+
31+
# PARAMETERS
32+
33+
**-a**
34+
> Disable aliases
35+
36+
**-f**
37+
> Disable shell functions
38+
39+
**-m**
40+
> Treat arguments as patterns for matching
41+
42+
**-p**
43+
> Disable shell parameters (variables)
44+
45+
**-r**
46+
> Disable reserved words
47+
48+
**-s**
49+
> Disable suffix aliases (zsh)
50+
51+
# DESCRIPTION
52+
53+
**disable** is a zsh builtin that prevents named elements from being used. When a builtin is disabled, the shell will search **$PATH** for an external command of the same name instead. This is useful for forcing the use of an external version of a command over the shell builtin, such as using an external **echo** or **test** instead of the builtin version.
54+
55+
Disabled elements can be re-enabled with the **enable** builtin.
56+
57+
# CAVEATS
58+
59+
Only available in zsh. In bash, the equivalent functionality is provided by **enable -n**. Disabling critical builtins like **cd** or **exit** can make the shell difficult to use. The effect does not persist across shell sessions unless added to shell configuration files.
60+
61+
# HISTORY
62+
63+
The concept of disabling builtins was introduced in **bash** with the **enable -n** syntax. **Zsh** provides the dedicated **disable** command as part of its more modular approach to shell configuration, extending the concept to functions, aliases, and reserved words.
64+
65+
# SEE ALSO
66+
67+
[enable](/man/enable)(1), [builtin](/man/builtin)(1), [zsh](/man/zsh)(1)

assets/commands/getln.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# TAGLINE
2+
3+
Read a line from the shell buffer stack
4+
5+
# TLDR
6+
7+
**Read a line from the buffer stack** into a variable
8+
9+
```getln [variable_name]```
10+
11+
**Read a line and process it**
12+
13+
```getln line && echo $line```
14+
15+
# SYNOPSIS
16+
17+
**getln** _name_ [_name ..._]
18+
19+
# DESCRIPTION
20+
21+
**getln** is a zsh builtin that reads the top entry from the shell's **buffer stack** and assigns it to the named variable. The buffer stack is a LIFO (last-in, first-out) data structure where lines can be pushed using **print -z** or **pushln** and later retrieved with **getln**.
22+
23+
If multiple variable names are given, the line is split into words and assigned to each variable in order, similar to **read**.
24+
25+
The buffer stack is typically used for programmatic input manipulation, where a script prepares command lines to be executed or processed later.
26+
27+
# CAVEATS
28+
29+
Only available in zsh. The buffer stack is a zsh-specific feature not found in other shells. If the buffer stack is empty, **getln** will assign an empty string. The buffer stack is separate from the command history.
30+
31+
# HISTORY
32+
33+
**getln** is part of **zsh's** buffer stack mechanism, a unique feature of the Z Shell that allows programmatic queuing and retrieval of text lines within the shell environment.
34+
35+
# SEE ALSO
36+
37+
[pushln](/man/pushln)(1), [print](/man/print)(1), [read](/man/read)(1), [zsh](/man/zsh)(1)

0 commit comments

Comments
 (0)