zoukankan      html  css  js  c++  java
  • mv command:unable to remove target: Is a director

    mv command:unable to remove target: Is a director

    This is somewhat simple as long as we understand the concept. mv or move does not actually move the file/folder to another location within the same device, it merely replaces the pointer in the first sector of your device. The pointer (in inode table) will be moved, but nothing is actually being copied. This will work as long as you stay within the same media/device.

    Now, when you try to move files from one device to another (/dev/sda1 to /dev/sdb1) you will run into “inter-device move failed, unable to remove target: Is a directory” error. This happens when mv has to actually move your data to another device, but cannot remove the inode/pointer, because if it did then there will be no data to fall back to, and if it didn’t then mv operation is not really complete because we will end up with data in source. Damned if you do and damned if you don’t, so it’s wise not to do it to begin with!

    In such situation cp is best. Copy your data over and then remove your source manually.

     

     cp  -r  /media/usb2/clone/  /media/usb1

  • 相关阅读:
    【题解】【模板】矩阵级数
    【题解】P2048 [NOI2010]超级钢琴
    【题解】[APIO2009]会议中心
    【题解】[P4178 Tree]
    【题解】扑克牌游戏
    【题解】quake
    【题解】cycle
    从不浪费——分治总结
    【题解】Painting Fence
    【题解】[CJOI2019Chebnear]
  • 原文地址:https://www.cnblogs.com/timssd/p/4575873.html
Copyright © 2011-2022 走看看