cp

Take a quick look at how to copy files in the unix environment using the cp command.
$ cp file1.a file2.b
If we execute the above command the contents of file1.a will be copied into file2.b. If file2.b doesn't exist then it will be created. If it already exists then the contents will be overwritten without any prompt.
We can also copy multiple files to a directory using the cp command.
$ cp file1.a file2.b sample
After executing the above command, the directory sample with have the copies of file1.a and file2.b

One more option is also available. Copying a file from one directory to another directory
$ cp /usr/bin/test1 /usr/tmp/test2
The contents of the file test1 will be copied to test2

0 comments:

 

©  3 column Minima Template by Bloganol