Results for “commands”
Small, practical examples. Search by task or narrow things down below.
Extract a compressed tar archive
Extract a trusted gzip-compressed tar archive into a dedicated destination directory.
tar✓ Tested
Find files by extension
Search a directory tree for regular files with a particular extension and print their paths.
find✓ Tested
Handle an expected command failure
Branch on a command’s exit code without aborting the script.
exit status✓ Tested
List files in a tar archive
Inspect the contents of a gzip-compressed tar archive without extracting any files.
tar✓ Tested
List running processes
Display process IDs, parent process IDs, and command names for all visible processes.
process✓ Tested
Pass an environment variable
Supply configuration without changing an image.
environment✓ Tested
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
Read a field from container metadata
Use an inspect template for stable machine-readable output.
inspect✓ Tested
Read output from a completed container
Retrieve the stdout captured by Docker.
logs✓ Tested
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
Run a command in a running container
Execute an additional process inside an existing container.
exec✓ Tested
Run a one-off container
Run a command and remove its stopped container automatically.
run✓ Tested