In Linux or Unix, the dash (-
) character is often used to specify options for command-line tools. As a result, files that start with a dash (-
) can be difficult to work with, as the dash may be interpreted as an option rather than a part of the file name.
To move a file that starts with a dash (-
) using the mv
command, you can use one of the following options:
./
prefix: By adding the ./
prefix to the file name, you can specify that the file is in the current directory. For example:mv ./filename destinationSource:www.lautturi.com
--
option: The --
option tells the mv
command to stop processing options and treat everything that follows as a file name. For example:mv -- filename destination
mv /path/to/filename destination
By using one of these options, you can move a file that starts with a dash (-
) using the mv
command in Linux or Unix.
Note: If you are using a file manager to move the file, you may be able to simply drag and drop the file to the destination folder without using any special options.