terminalubuntu-14.04

How to get rid of permision denied while using mv command?


I am trying to move a file from one directory to other by command line.I used this command

raghul@raghul-Aspire-5750Z:~/temp/newfolder$ mv copy.txt /temp/

I got error like this

cannot create regular file '/temp': Permission denied

Can someone help me to figure this out? I need to move a file from one directory to other.


Solution

  • I just noticed that you're in a personal directory called ~/temp/newfolder. Is that the temp you're trying to move the file to: your personal one, in which newfolder is in? So you want to move the file up one directory?

    Then the problem is that your command is missing the 'personal' tag ~. The command should be:

    mv copy.txt ~/temp/