0

i am at fickurthe first one and trying to move the inner fickur to digital with only one command line, but cant seem to figure this one out. photo here is what i have tried so far:

mv -v fickur/ ./klockor/armbandsur/digital

results:

mv: rename fickur/ to ./klockor/armbandsur/digital: No such file or directory

  • 1
    Your target directory is missing. Try mkdir./klockor/armbandsur/digital and try again – ADDB Jun 14 '17 at 9:12
  • i have all the directories needed just as shown in the photo so that isnt the problem – Reddevil Jun 14 '17 at 9:14
1

If you are inside the dir fickur (the rectangular one in the drawing), do

mv fickur/ ../armbandsur/digital/
  • Thanks a lot for your concise answer, any idea how i could go about copying fickur (the flag shaped one) to digital if i am in currently inside digital ? i was thinking something like cp -r ../../fickur/fickur digital but that doenst seem to work – Reddevil Jun 14 '17 at 10:57
  • cp -r ../../fickur/fickur . should work. – dr01 Jun 14 '17 at 11:11
0

If you are unsure how many ../ to do you can always use the full path. With tab completion sometimes it is clearer and pretty quick to type. For example (assuming klockor is at /):

mv -v /klockor/flickur/flickur /klockor/armbandsur/digital/
0

When a path doesn't start with /, it is relative. A relative path is usually relative to the current working directory (an exception is targets of symlinks that are relative to the parent of the symlink). . is an entry in any directory that points to itself.

mv -v fickur/ ./klockor/armbandsur/digital

is the same as

mv -v fickur/ klockor/armbandsur/digital

If your current directory is the first fickur, there's no klockor directory in it, so that can't work. There is no klockor directory in the parent of fickur either. There would be one in the parent of its parent, but here, you don't need to go that far up if you want to move it to a subdirectory of your parent directory. armbandsur is a subdirectory of the parent of fickur, so you can just do

mv -v fickur ../armbandsur/digital

.. here being the parent directory of the current directory.

Note that if the structure you're describing above includes symlinks, for instance, if fickur is not a real directory but a symbolic link, then the .. in the directory it points to may point to a different directory than klockor. Also if the second fickur is also a symlink and to a relative path, then when moved to a different location, that link is likely to become broken.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.