Antergos Linux Terminal Tutorial for Beginners

March 20, 2018 | By the+gnu+linux+evangelist | Filed in: Tutorial.

Copying

  1. 5. Copying Stuff

    Experiment How to Copy Directories and Files

    • To Copy a Single File:
      * As in the other cases here ‘cp‘ is the Abbreviation for ‘Copy‘ *

      cp $HOME/livingroom/box $HOME/bedroom/

      You see how in this Example we moved our ‘box’ from the ‘livingroom’ to the ‘bedroom’ :)

      Now verify the correctness of the operation Listing your’s bedroom contents:

      ls $HOME/bedroom/

      And the Output will exactly display as:

      box
    • Now for Instance to Copy a Single Directory inside to another do:

      cp -r $HOME/livingroom $HOME/garden

      List the ‘garden’ contents:

      ls $HOME/garden

      And you’ll Find:

      livingroom

      Now you have also a ‘livingroom’ copy into your ‘garden’ O:

      Moreover to Copy-Duplicate-Rename a Directory:

      First to be sure you are again into the $HOME area:

      cd 

      And then Make a newly duplicated room do:

      cp -r ./livingroom ./room

      Finally, to Copy-Displace-Rename at the same time:

      cp -r $HOME/livingroom $HOME/bedroom/wardrobe

      But this is Magically Crazy, we have trasformed our ‘livingroom’ into a ‘wardrobe’ inside to the ‘bedroom’ :))


Tags: , , , , , , , ,

QuickChic Theme • Powered by WordPress