# Delete files (/guides/runtime/delete-file)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 86 · updated: 2026-07-28 -->
Related: [Delete directories](/guides/runtime/delete-directory.md), [Import a HTML file as text](/guides/runtime/import-html.md), [Import a JSON file](/guides/runtime/import-json.md), [Import a JSON5 file](/guides/runtime/import-json5.md), [Import a TOML file](/guides/runtime/import-toml.md), [Import a YAML file](/guides/runtime/import-yaml.md)

To delete a file, use `Bun.file(path).delete()`.

```ts icon="/icons/typescript.svg" title="delete-file.ts"
// Delete a file
const file = Bun.file("path/to/file.txt");
await file.delete();

// Now the file doesn't exist
const exists = await file.exists();
// => false
```

***

See [File I/O](/runtime/file-io) for more filesystem operations.
