# Delete a file (/docs/guides/write-file/unlink)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 72 · 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), [Write a file to stdout](/docs/guides/write-file/cat.md), [Copy a file to another location](/docs/guides/write-file/file-cp.md), [Write a file incrementally](/docs/guides/write-file/filesink.md)

The `Bun.file()` function accepts a path and returns a `BunFile` instance. Use the `.delete()` method to delete the file.

```ts
const path = "/path/to/file.txt";
const file = Bun.file(path);

await file.delete();
```

***

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