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?
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
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’…
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.
Post a Comment