To copy a file into another directory, use the
cp command with the file name as the first argument, and the target path name as the second.
$ cp fileName destination
You may rename the file by attaching it to the end of the path.
$ cp fileName destination/newFileName
This takes a file, and sends a copy of it to the specified path, with the new file name.
And to copy into the same directory with a new name:
$ cp fileName newFileName
To copy directories and the contents within, we must apply the
-r option, which is the command to copy recursively.
The following command would copy all contents of dir1 into dir2.
$ cp -r dir1 dir2
We can copy multiple items at once into a directory. As long as the last argument is the path name, we're good.
$ cp file1 file2 file3 pathName
Here are some additional options for fine-tuning.
Linux for Beginners doesn't make any assumptions about your background or knowledge of Linux. You need no prior knowledge to benefit from this book. You will be guided step by step using a logical and systematic approach. As new concepts, commands, or jargon are encountered they are explained in plain language, making it easy for anyone to understand.$ Check price
Stretch out your back and relieve your back muscles with inversion therapy. This device counteracts the forces of gravity on the body by decompressing and elongating the spine. By using this product just ten minutes a day, you can be well on your way to improved circulation and posture while relieving muscle aches, back pain and stress.$$ Check price