Skip to content

Question of the Day - 16 Aug 2007

You have a directory called /home/ben/memos and want to move it to /home/bob/memos so you issue the command

mv /home/ben/memos /home/bob

What is the results of this action?

2 Comments

  1. Let’s see if I can answer this without actually trying it:-) My first guess is that the answer is - it depends. In most cases, you would end up with a directory called ‘memos’ in bob’s folder and it would now be missing in ben’s. But I think it behaves differently if the folders are on different mounted drives.

    Btw, the first few times I read this, I missed the subtle distinction between ‘ben’ and ‘bob’, and thought you were doing ‘mv /home/ben/memos /home/ben’…

    Posted on 17-Aug-07 at 6:35 am | Permalink
  2. James Bannon

    Unless you have correct permissions for you as the user on /home/ben/memos and in /home/bob you will get a permission denied error.

    P.S. The latest version of the mv command will move directories across file system boundaries.

    Posted on 19-Aug-07 at 1:47 pm | Permalink

Post a Comment

Your email is never published nor shared.