Linux Terminal
    Files & Folders
    Caution
    Linux (bash/zsh)
    macOS Terminal
    WSL

    Extract an archive in Linux Terminal

    -x extract, -z gzip, -f file. Add -C {dst} to choose the output folder. List contents first with tar -tzf.

    Template

    tar -xzf {src}

    Complete example

    $ tar -xzf backup.tar.gz

    Changes your system: it can install, move, restart or elevate. Check the target before you run it. Copying puts it on your clipboard — it runs on a real system only when you paste and press Enter there. The practice terminal is a simulator and never touches your machine.

    Where it runs

    Supported environments
    Linux (bash/zsh) · macOS Terminal · WSL
    Expected output
    Not documented yet on this page.
    Verification status
    Execution tested — documentation reviewed on 2026-11-22. Documentation-checked and also run for real in a disposable fixture directory.
    Executed on 2026-11-22 in Linux 4.19.0-gvisor / bash (disposable fixture directory).
    Documentation link last checked on 2026-11-22 (reachable).

    Parameter explorer

    Archive path

    Template previewFill in the required values first
    $ tar -xzf {src}

    Still a template — fill in {src}.

    Parameters

    src
    Archive path

    AI insights for this command

    Get a plain-English explanation, expected output, common errors + fixes, safer alternatives, and best practices — generated for this exact command.

    Free account — the reference below stays open to everyone.

    Same task in other shells

    Was this helpful?