Linux commands to learn -mv command

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

  1. In testA directory, TESTD folder to the current user's home directory
    mv testD ~ /
  2. In testB directory, move the file to testA test.ini folder
    mv test.ini ../testA/
  3. In testA directory, testB1 folder name to testA1
    mv testB1 testA1
  4. 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

Guess you like

Origin www.cnblogs.com/wintest/p/11183703.html