root@47dac26876d7:/# cd /root
root@47dac26876d7:~# ls
empty_directory not_here old_school ready_to_be_removed school so_cool
root@47dac26876d7:~# cp school
cp: missing destination file operand after 'school'
Try 'cp --help' for more information.
1 Answers
man cp
will provide you with a brief manual on the command. It is written in compact and rather technical language, efficient if you have some experience with the linux shell, but rather terse and difficult to access for new users. It is rather advised that new users should learn the basics from either textbooks or tutorial websites.
The documentation, man cp
says
cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... -t DIRECTORY SOURCE...
In each of the three use forms, at least two arguments are needed, the SOURCE
and the DEST
or target DIRECTORY
.
So you need a second argument that tells the cp
command where to copy the file. That could be another file name, in the current directory or in a totally different location (first form), or an existing directory (second form). Third form uses the option -t
to specify a target DIRECTORY
before the SOURCE
(one or multiple file names, ad indicated by the ...
).
Warning As a new user unfamiliar with a basic command such as cp
, you are playing with fire running a terminal as root user and trying to shuffle files around in the system files area. Don't, or be prepared to reinstall your system now and then. Only use sudo privileges where absolutely necessary to modify the system. In that context, it is good practice to never drop to a root prompt, but just prepend these commands that need to be run with root privileges with sudo
.
cp: missing destination file operand after 'school'
andTry 'cp --help' for more information.
... – Soren A Aug 19 '22 at 06:07/root
? Please use/home/$USER/Documents
for this kind of things – Rinzwind Aug 20 '22 at 12:17