# Bun Get the path to an executable bin file

> Get the path to an executable bin file

- Skill: `jarle/bun-get-the-path-to-an-executable-bin-file` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jarle/bun-get-the-path-to-an-executable-bin-file`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jarle/bun-get-the-path-to-an-executable-bin-file/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jarle (https://skillmd.com/u/jarle)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/jarle/bun-get-the-path-to-an-executable-bin-file

---


# Get the path to an executable bin file

`Bun.which` is a utility function to find the absolute path of an executable file. It is similar to the `which` command in Unix-like systems.

```ts foo.ts icon="https://mintcdn.com/bun-1dd33a4e/nIz6GtMH5K-dfXeV/icons/typescript.svg?fit=max&auto=format&n=nIz6GtMH5K-dfXeV&q=85&s=5d73d76daf7eb7b158469d8c30d349b0" theme={"theme":{"light":"github-light","dark":"dracula"}}
Bun.which("sh"); // => "/bin/sh"
Bun.which("notfound"); // => null
Bun.which("bun"); // => "/home/user/.bun/bin/bun"
```

***

See [Docs > API > Utils](/runtime/utils#bun-which) for complete documentation.

