# Get the path to an executable bin file (/docs/guides/util/which-path-to-executable-bin)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 81 · updated: 2026-07-28 -->
Related: [Upgrade Bun to the latest version](/docs/guides/util/upgrade.md), [Detect when code is executed with Bun](/docs/guides/util/detect-bun.md), [Get the current Bun version](/docs/guides/util/version.md), [Hash a password](/docs/guides/util/hash-a-password.md), [Generate a UUID](/docs/guides/util/javascript-uuid.md), [Encode and decode base64 data](/docs/guides/util/base64.md)

`Bun.which` finds the absolute path of an executable file, like the `which` command on Unix-like systems.

```ts foo.ts icon="/icons/typescript.svg"
Bun.which("sh"); // => "/bin/sh"
Bun.which("notfound"); // => null
Bun.which("bun"); // => "/home/user/.bun/bin/bun"
```

***

See [`Bun.which`](/runtime/utils#bun-which).
