> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/r/rename_a_file.md).

# Rename a file

```ruby
# Here
File.rename('input.txt', 'output.txt')
File.rename('docs',      'mydocs')
 
# Root dir
File.rename(Dir.root + %f'input.txt', Dir.root + %f'output.txt')
File.rename(Dir.root + %f'docs',      Dir.root + %f'mydocs')
```
