In Linux, mv command stands for move, the main role is to move a file or folder, similar to the cut function under Windows, but also can be used to change the name.
Suppose the user is currently in the home directory WinTest, the path is / home / wintest, testA folder exists, and TestC testB, subfolders exist testD testB1 and lower testA folder, file exists testB test.ini
- In testA directory, TESTD folder to the current user's home directory
mv testD ~ / - In testB directory, move the file to testA test.ini folder
mv test.ini ../testA/ - In testA directory, testB1 folder name to testA1
mv testB1 testA1 - Moving multiple files, the folders testB testA and move to the next TestC
mv testA testB -t ~ / testC
Note: In multi-file movement, -t Indicates that the specified target directory for testC, testC not for file