1e41f4b71Sopenharmony_ci# mv 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## Command Function 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciThis command is used to move files. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## Syntax 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_cimv [_-fivn_] *SOURCE... DEST* 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci## Parameters 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci**Table 1** Parameter description 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci| Parameter | Description | Value Range | 19e41f4b71Sopenharmony_ci| ------ | ------------------------------------------------------------ | ----------------------------------------------- | 20e41f4b71Sopenharmony_ci| -help | Displays help information. | N/A | 21e41f4b71Sopenharmony_ci| -f | Forcibly overwrites the target file. | N/A | 22e41f4b71Sopenharmony_ci| -i | Provides information before moving a file that would overwrite an existing file or directory. Enter **y** to overwrite the file or directory, and enter **n** to cancel the operation.| N/A | 23e41f4b71Sopenharmony_ci| -n | Do not overwrite any existing file or directory. | N/A | 24e41f4b71Sopenharmony_ci| -v | This parameter does not take effect although it is supported by the latest Toybox code. | N/A | 25e41f4b71Sopenharmony_ci| SOURCE | Specifies the file to move. | This command cannot be used to move a directory. It can be used to move multiple files at a time.| 26e41f4b71Sopenharmony_ci| DEST | Specifies the destination file path. | Both a directory and a file are supported. | 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci## Usage Guidelines 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci- **SOURCEFILE** supports wildcard characters * and ?. The asterisk (*) indicates any number of characters, and the question mark (?) represents a single character. **DEST** does not support wildcard characters. If the specified **SOURCE** matches multiple files, **DEST** must be a directory. 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci- If **DEST** is a directory, this directory must exist. In this case, the destination file is named after the source file. 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci- If **DEST** is a file, the directory for this file must exist. 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci- If the destination file already exists, it will be overwritten. 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci## Note 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ciCurrently, the shell does not support this command. mksh supports it. To switch to mksh, run **cd bin** and **./mksh**. 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ci## Example 44e41f4b71Sopenharmony_ci 45e41f4b71Sopenharmony_ciRun the following commands: 46e41f4b71Sopenharmony_ci 47e41f4b71Sopenharmony_ci- mv -i test.txt testpath/ 48e41f4b71Sopenharmony_ci 49e41f4b71Sopenharmony_ci- mv test?.txt testpath/ (Move **test3.txt**, **testA.txt**, and **test_.txt**) 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci## Output 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_ciExample 1: Move a file. 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ci``` 58e41f4b71Sopenharmony_ciOHOS:/$ touch test.txt 59e41f4b71Sopenharmony_ciOHOS:/$ mkdir testpath 60e41f4b71Sopenharmony_ciOHOS:/$ touch testpath/test.txt 61e41f4b71Sopenharmony_ciOHOS:/$ mv -i test.txt testpath/ 62e41f4b71Sopenharmony_cimv: overwrite 'testpath//test.txt' (Y/n):y 63e41f4b71Sopenharmony_ciOHOS:/$ ls 64e41f4b71Sopenharmony_cibin etc proc storage testpath usr 65e41f4b71Sopenharmony_cidev lib sdcard system userdata vendor 66e41f4b71Sopenharmony_ciOHOS:/$ cp testpath/test.txt ./ 67e41f4b71Sopenharmony_ciOHOS:/$ ls 68e41f4b71Sopenharmony_cibin etc proc storage test.txt userdata vendor 69e41f4b71Sopenharmony_cidev lib sdcard system testpath usr 70e41f4b71Sopenharmony_ciOHOS:/$ mv -i test.txt testpath/ 71e41f4b71Sopenharmony_cimv: overwrite 'testpath//test.txt' (Y/n):n 72e41f4b71Sopenharmony_ciOHOS:/$ ls 73e41f4b71Sopenharmony_cibin etc proc storage test.txt userdata vendor 74e41f4b71Sopenharmony_cidev lib sdcard system testpath usr 75e41f4b71Sopenharmony_ci``` 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ciExample 2: Move files. 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ci 80e41f4b71Sopenharmony_ci``` 81e41f4b71Sopenharmony_ciOHOS:/$ ls 82e41f4b71Sopenharmony_cibin etc proc storage test.txt testA.txt testpath usr 83e41f4b71Sopenharmony_cidev lib sdcard system test3.txt test_.txt userdata vendor 84e41f4b71Sopenharmony_ciOHOS:/$ mv test?.txt testpath/ 85e41f4b71Sopenharmony_ciOHOS:/$ ls 86e41f4b71Sopenharmony_cibin etc proc storage test.txt userdata vendor 87e41f4b71Sopenharmony_cidev lib sdcard system testpath usr 88e41f4b71Sopenharmony_ciOHOS:/$ ls testpath/ 89e41f4b71Sopenharmony_citest.txt test3.txt testA.txt test_.txt 90e41f4b71Sopenharmony_ci``` 91