FIND YOUR NEXT FEW LINES

Results for “commands”

Small, practical examples. Search by task or narrow things down below.

149 snippets foundClear filters
Linux CommandsArchives & checksums

Extract a compressed tar archive

Extract a trusted gzip-compressed tar archive into a dedicated destination directory.

tar✓ Tested
Linux CommandsFiles & folders

Find files by extension

Search a directory tree for regular files with a particular extension and print their paths.

find✓ Tested
Bash ScriptsFunctions & arguments

Handle an expected command failure

Branch on a command’s exit code without aborting the script.

exit status✓ Tested
Linux CommandsArchives & checksums

List files in a tar archive

Inspect the contents of a gzip-compressed tar archive without extracting any files.

tar✓ Tested
Linux CommandsSystem information

List running processes

Display process IDs, parent process IDs, and command names for all visible processes.

process✓ Tested
Docker / ComposeContainer commands

Pass an environment variable

Supply configuration without changing an image.

environment✓ Tested
Bash ScriptsProcesses & environment

Preserve a failure status while an EXIT trap runs

Bash Scripts: Capture the status immediately on entry to the trap before running cleanup commands.

Bash Scripts✓ Tested
Docker / ComposeContainer commands

Read a field from container metadata

Use an inspect template for stable machine-readable output.

inspect✓ Tested
Docker / ComposeContainer commands

Read output from a completed container

Retrieve the stdout captured by Docker.

logs✓ Tested
Linux CommandsText processing

Replace text with sed

Replace all occurrences of the substring old on each line and print the transformed text without changing the input file.

sed✓ Tested
Docker / ComposeContainer commands

Run a command in a running container

Execute an additional process inside an existing container.

exec✓ Tested
Docker / ComposeContainer commands

Run a one-off container

Run a command and remove its stopped container automatically.

run✓ Tested