"cp" is not working
14,719
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/
Related videos on Youtube
Author by
Double S
Updated on September 18, 2022Comments
-
Double S almost 2 years
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 namedmas
and I am quite sure thatvlsi
is a directory.What is the error of my code?
-
Jos about 8 yearsTry
cp b vlsi/
. However, that supposes that the fileb
is in your current directory, and so is the sub-directoryvlsi
. -
Jos about 8 yearsIn that case,
vlsi
is a subdirectory of your home directory and can be addressed as~/vlsi
, with~
short for/home/yourusername
. So the copy command should becp b ~/vlsi/
. -
Jos about 8 yearsTry again. You probably typed a space between
~
and/vlsi/
. -
Double S about 8 yearsyou are right thanks..can you please provide me an answer for this: cp: cannot create regular file ‘/./b’: Permission denied
-
Jos about 8 yearsYou must have made another typo, because now you are trying to copy the file b to the root directory
/
(the extra./
does nothing). The commandcp b ~/vlsi/
should work.
-