List only matching files inside a compressed tar archive
Build a paste-ready command, then review its compatibility and effects before running it.
tar -tzf <archive-file> | rg <pattern>Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
Linux + macOSVerified for Linux, macOS using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementstartar must be installed and available on PATH.
Version supporttar Current supported releasesVerified for linux, macos using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsapp/config/defaults.yamlRepresentative successful output; values vary with the selected target and system state.
Known errorstar: command not foundtar is missing or is not available on PATH.
Verifytar -tzf {{archiveFile}} | rg {{pattern}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01tarCommandRuns the tar stage of this one-liner.
02-tzfOptionConfigures tar with the -tzf option.
03<archive-file>ParameterA value supplied in the Fill parameters section.
04|PipelinePasses the output on the left to the command on the right.
05rgCommandRuns the rg stage of this one-liner.
06<pattern>ParameterA value supplied in the Fill parameters section.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
tar -tzf release.tar.gz | rg '\.(env|yaml)$'
Example output
app/config/defaults.yaml
app/deploy/production.yaml
app/.env
Illustrative output — exact values vary by system and data.
Official sources