TRY(1)
π TRY(1) β run a command in an overlay π
okay so bestie, this is TRY(1), and the header tagline is βDo, or do not. There is no try.β β honestly iconic. We're about to run a command inside an overlay without touching the state of the filesystem. No cap. π¦
πΈ NAME πΈ
try β run a command in an overlay.
β¨ SYNOPSIS β¨
try [-ny] [-E PATTERN] [-I PATTERN] [-i PATH] [-N DIR] [-U PATH] [-L
LOWER_DIRS] CMD [ARG ...]
try summary [DIR]
try commit [DIR]
try explore
try -v
try -h
π¦ DESCRIPTION π¦
try lets you run a command inside an overlay without modifying the state of the filesystem.
While using try you can choose to commit the result to the filesystem or completely discard it without any side-effect to the main file system. Slay.
You can also choose your own shell when running try. try will run your command within your login shell by default; you can override this by setting the TRY_SHELL variable to the absolute path of a shell to use.
π© Flags π©
-nβ Don't commit or prompt for commit. Just return the overlay directory. Overrides-y.-yβ Assume yes to all prompts. Overrides-n.-vβ Show version information (and exit).-hβ Show a usage message (and exit).-xβ Prevent network access (by unsharing the network namespace).
βοΈ Options βοΈ
-E PATTERNβ Exclude paths that matchPATTERNonsummaryandcommit. This option can be passed multiple times; the patterns given will be used in a pattern file passed togrep -v.-I PATTERNβ Include only paths that matchPATTERNonsummaryandcommit. This option can be passed multiple times; the patterns given will be used in a pattern file passed togrep.-i PATHβ HidePATHinside the sandbox. Relative paths are resolved from the directory wheretryis invoked. This option can be passed multiple times.-N DIRβ SpecifyDIRas the overlay directory (implies-n). The use of-Nalso implies thatDIRalready exists.-U PATHβ Use the unionfs helper implementation defined in thePATH(e.g.,mergerfs,unionfs-fuse) instead of the default. This option is recommended in case OverlayFS fails.-L LOWER_DIRSβ Specify a colon-separated list of directories to be used as lower directories for the overlay, formatted as"dir1:dir2:...:dirn"(implies-n).
π§ Subcommands π§
try summary DIRβ Show the summary for the overlay inDIR.try commit DIRβ Commit the overlay inDIR.try exploreβ Run in interactive mode, i.e., start a shell in the overlay.
π Arguments π
CMDβ Specifies the command to execute inside the overlay.ARGβ The arguments ofCMD.
π EXIT STATUS π
0β Command ran successfully.1β Consistency error/failure.2β Input or other internal error.
π EXAMPLES π
The general workflow is to try a command before committing its results to your workspace.
To uncompress a gzip file, you can invoke try as follows:
try gunzip file.txt.gz
By default, try will ask you to commit the changes made at the end of its execution.
Changes detected in the following files:
/tmp/tmp.0caZdxnHuR/upperdir/home/me/file.txt
/tmp/tmp.0caZdxnHuR/upperdir/home/me/file.txt.gz
Commit these changes? [y/N] y
Sometimes, you might want to pre-execute a command and commit its result at a later time. Invoking try with the -n flag will return the overlay directory, without committing the result.
try -n gunzip file.txt.gz
Alternatively, you can specify your own overlay directory as follows (note that try_dir already exists):
try -N try_dir gunzip file.txt.gz
To use multiple lower directories for overlay (by merging them), you can use the -L flag followed by a colon-separated list of directories. The directories on the left have higher precedence and can overwrite the directories on the right:
try -L /lowerdir1:/lowerdir2:/lowerdir3 gunzip file.txt.gz
You can inspect the changes made inside a given overlay directory:
try summary try_dir
You can also choose to commit the overlay directory contents:
try commit try_dir
π SEE ALSO π
checkinstall(1), chroot(1), unshare(1), mount_namespaces(7), namespaces(7), mount(8)
π BUGS π
See https://github.com/binpash/try/issues.
π LICENSE π
Copyright (c) 2023 The PaSh Authors. MIT licensed.
π AUTHORS π
The PaSh Authors.
Byeee π β footer check: version try 0.2.1, manual TRY(1), date: not listed in the footer, so I'm not inventing one. Periodt. π«Ά
π¦ where this page comes from
- nixpkgs unstable: try 0.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms