Monday, 3 July 2017

cp command examples in Linux

1) Copy single file on same directory
cp abc.txt  abc1.txt

2) Copy single file on different directory
cp abc.txt  /home/unix/abc1.txt

3) Copy multiple files with same extension in different directory
cp *.txt  /home/unix/

4) Copy multiple files in different directory
cp abc.txt abc1.txt abc2.txt /home/unix/

5) Copy a directory to different directory
cp -R xyz/ /home/unix/

6) Copy multiple directory to different directory
cp -R xyz/ abc/ abc1/ /home/unix/

7) Copy a file with preserve file attributes (permissions, group and user owernship)
cp --preserve abc.txt  abc1.txt

8) Creating a hard link with cp command
cp -l abc.txt abc1.txt

9) Creating a soft link with cp command
cp -s abc.txt /home/unix/abc1.txt

10) Showing progress of cp command
cp -v *.txt /home/unix/

Related Topics :-
find command examples  mv command examples  ps command examples tar command examples  scp command examples touch command examples 

1 comment:

  1. Thanks for the given information you are providing content very usefull to users.
    Learn How to Work With Ref Cursor in ORACLE 12C For Beginner Actual cost of this course is 9,999/- But now Kuncham Software Solutions Pvt ltd is giving you Free access. Limited period offer Hurry-up Enroll Now at Udemy.

    Hurry-Up Enroll Now and get Free Access to the Entire Course


Cloning database with RMAN

Below are the steps to clone production database(primedb) to UAT database(clonedb)   STEP1 :- Check the both servers are able to connect ...