# 6.4.9 RENAME DIRECTORY

Part of: [6 Language](6-language.md) › [6.4 Data Definition Language (DDL)](6-4-data-definition-language-ddl.md)

### Syntax

**RENAME** **DIRECTORY** _directory_name_ [**,** _directory_name_]\* **AS** _new_directory_name_ [**,** _new_directory_name_]\*

### Description

Rename (or move) an existing directory named _directory_name_ as _new_directory_name_. Multiple directories can be renamed (or moved) at once by separating their names with a comma (,). If _new_directory_name_ already exists, it is not overwritten, no subsequent directories are renamed (or moved), and an error is raised.

### Parameter(s)

_directory_name_ – mandatory string that specifies the name of the directory to rename (or move).

_new_directory_name_ – mandatory string that specifies the new name and/or location in the file system to use for renaming and/or moving _directory_name_.

### Return

Nothing

### Example(s)

```hdfql
# rename a directory named "my_directory0" as "my_directory1" (the directory "my_directory1" will not be overwritten if it already exists)
RENAME DIRECTORY my_directory0 AS my_directory1

# rename two directories named "my_directory2" and "my_directory3" as "my_directory4" and "my_directory5", respectively (neither directory will be overwritten if it already exists)
RENAME DIRECTORY my_directory2, my_directory3 AS my_directory4, my_directory5

# move a directory named "my_directory6" into a root directory named "data" and rename it as "my_directory7" (the directory "my_directory7" will not be overwritten if it already exists)
RENAME DIRECTORY my_directory6 AS /data/my_directory7

# move a directory named "my_directory8" into a relative directory named "backup" (the directory "my_directory8" will not be overwritten if it already exists)
RENAME DIRECTORY my_directory8 AS backup/
```
