# Escaping a hyphen at the start of a filename in bash In Bash,`-file.txt` cannot be renamed as it is interpreted as a command when using relative paths. The solution is either to use an absolute path e.g. `mv /home/user/-file.txt file.txt` or using the `--` separator: `mv -- -file.txt file.txt`. > [!INFO] > Using `--` as a separator is not supported by all commands. --- ## Related - **previous** [[Entrypoint]] - **see** [[Bash]] for the command line scripting language ## Sources - **references** none ## Usage - **used in** none