M BUZZ CRAZE NEWS
// general

"cp" is not working

By Emma Johnson

I am a newcomer in Linux. I tried to copy a file into another directory but it says that the directory does not exist.

I tried this:

cp b / vlsi

Here b is the file which is at another directory named mas and I am quite sure that vlsi is a directory.

What is the error of my code?

5

1 Answer

The command is cp b vlsi/ meaning: copy the file b into the directory vlsi.

If the file b or the target directory are not in the current directory (the directory from which you are issuing the command), you need to give the whole path. In your case, the directory vlsi is not in the current directory, but in your home directory. So the full command becomes:

cp b /home/yourusername/vlsi/

However, instead of typing /home/yourusername you can simply type the symbol ~. So this command does the same thing:

cp b ~/vlsi/

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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