How to Copy Files in Linux

Move to the directory you want to copy your files from., Use the copy command to move your files to the directory you want., Move to the folder you copied the file to and check if it copied correctly.

3 Steps 1 min read Easy

Step-by-Step Guide

  1. Step 1: Move to the directory you want to copy your files from.

    To move a file from the home folder into the documents folder, you first need to use the "cd" command to move into your home folder: cd ~
  2. Step 2: Use the copy command to move your files to the directory you want.

    Now that you are in the folder you want to copy files from, choose which file you want to copy and run the "cp" command to copy it to the folder you want it copied to.

    So if the file you want copied to the documents folder is called myFile.txt, the command to use is... cp myFile.txt documents , The best way to do this is by running these commands and finding your file in the list. cd documents ls
  3. Step 3: Move to the folder you copied the file to and check if it copied correctly.

Detailed Guide

To move a file from the home folder into the documents folder, you first need to use the "cd" command to move into your home folder: cd ~

Now that you are in the folder you want to copy files from, choose which file you want to copy and run the "cp" command to copy it to the folder you want it copied to.

So if the file you want copied to the documents folder is called myFile.txt, the command to use is... cp myFile.txt documents , The best way to do this is by running these commands and finding your file in the list. cd documents ls

About the Author

S

Samantha Lewis

Creates helpful guides on DIY projects to inspire and educate readers.

83 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: