0

Hi I am trying to move a file from a folder to another but cannot make it.

enter image description here

Those are command I tried:

enter image description here

You see those folders are with space in their name?

MarianD
  • 1,028
  • 1
    Please avoid screen-shots. You can copy and paste terminal-output . Use code-tags for formatting (<pre>...terminal-output...</pre>) – mook765 Sep 22 '16 at 21:36

1 Answers1

1

It seems as though you are missing proper address of the files you are moving. I cannot see the full line of what you are trying but I would say that to move the files you should use:

sudo mv ~/Desktop...

or

sudo mv /home/username/Desktop ...

Alternatively, if you are already in the folder that contains /Desktop you could do

sudo mv ./Desktop....

That is, what you are missing is what comes before /Desktop as what you currently have there is saying that at the root of your file system there is a folder called Desktop which, in most installations, this is not the case as the Desktop folder is under the user's home folder (i.e., inside /home/username/).

(LinuxRev: permissions should not be an issue as he is trying as a sudo.)

A quick search search for "How to move files and folders from linux terminal" shows many sources including this one: HowTo: Move A Folder In Linux Using mv Command

Juan Antonio
  • 1,572
  • Yes, he may still have to change permissions. Also he may or may not have to use the sudo command. I tested it on mine and didn't have too, but I understand that on some operating systems you might need too. – BJsgoodlife Sep 22 '16 at 14:16
  • Those 3 are not valid commands. – Rinzwind Sep 22 '16 at 14:16
  • They are only the first part of the command to move a single file. That is just to show how the folder structure works. – Juan Antonio Sep 22 '16 at 14:19
  • It is not about permissions error says no directory.. I enter that "sudo mv /Home/Desktop/caglarcan/test2" caglarcan is folder that test2 is inside? – user96369 Sep 22 '16 at 14:19
  • Indeed, as explained above, there is no folder /Desktop at the root, it is inside the user. As commented above, you may NOT need to use sudo at all, depends on where you want to move things. If is from a user folder to the another folder owned by the same user, then you should not. Only is you are moving to a system folder or to the folder of a user you do not have group or other permissions to write. – Juan Antonio Sep 22 '16 at 14:22
  • I moved it by 1st and 3 rd commands but 2nd command does not make sense to me. Why do i put my user name after Home folder? – user96369 Sep 22 '16 at 14:39
  • You would need to do it if you want to give the full address or absolute address of a file or folder. Have in mind that in linux the forward slash "/" means the root folder. That is, the base folder of your directory structure. – Juan Antonio Sep 22 '16 at 15:22
  • So your original command asking to move /Desktop said: "move" the file or folder in "Desktop etc" which itself located in "/" (the root folder). Therefore, adding "/home/username" (where you replace "username" by your actual username) is saying: "move" the files under "Desktop ... folder" which itself is located in "/home/username/" folder. The first command is no different than this one as in linux's "~" means "/home/username". Therefore, commands 1 and 2 above are, in essence, the same. – Juan Antonio Sep 22 '16 at 15:22
  • Command 3 is different as it assumes the current active folder (which can be obtained using pwd command) is the default folder when one opens the terminal which is the home or ~ folder. In essence the "." folder means: "the current folder". (FYI: ".." means the folder one level higher from the current (i.e., ".") folder.

    [Sorry... I had to break this into three comments as there is a limit in the length of the comments.]

    – Juan Antonio Sep 22 '16 at 15:23