# Write a file to stdout (/docs/guides/write-file/cat)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 112 · updated: 2026-07-28 -->
Related: [Append content to a file](/docs/guides/write-file/append.md), [Write a string to a file](/docs/guides/write-file/basic.md), [Write a Blob to a file](/docs/guides/write-file/blob.md), [Copy a file to another location](/docs/guides/write-file/file-cp.md), [Write a file incrementally](/docs/guides/write-file/filesink.md), [Write a Response to a file](/docs/guides/write-file/response.md)

Bun exposes `stdout` as a `BunFile` with the `Bun.stdout` property. Pass it as the destination to [`Bun.write()`](/runtime/file-io#writing-files-bun-write).

The following code writes a file to `stdout`, like the Unix `cat` command.

```ts cat.ts icon="/icons/typescript.svg"
const path = "/path/to/file.txt";
const file = Bun.file(path);
await Bun.write(Bun.stdout, file);
```

***

See [`Bun.write()`](/runtime/file-io#writing-files-bun-write).
