Linux Terminal
    Environment
    Safe
    Linux
    macOS
    WSL

    Locate a command in Linux Terminal

    Prints the first match on PATH. command -v {name} is the POSIX-portable form; type -a {name} also shows builtins and aliases.

    Template

    which {name}

    Complete example

    $ which python3

    Read-only — it reports information and does not change your system. 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 · macOS · 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

    Command name

    Template previewFill in the required values first
    $ which {name}

    Still a template — fill in {name}.

    Parameters

    name
    Command name

    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?