Copy files in Linux

Author: Robert Simon
Date Of Creation: 24 June 2021
Update Date: 1 July 2024
Anonim
Moving and Copying Files and Directories in Linux
Video: Moving and Copying Files and Directories in Linux

Content

This wikiHow teaches you how to copy and paste a file onto a Linux computer. You can use command lines to copy and paste files, or you can use keyboard shortcuts or the right mouse button and the context menu if you are using a Linux version with a user interface.

To step

Method 1 of 2: Using command lines

  1. Open the terminal. Click or double-click the terminal icon. Usually this looks like a black square with a white "> _" on it.
    • You can also click on most Linux versions Alt+Ctrl+T. Press to open the terminal.
  2. Go to the correct directory. Tap cd path where "path" is the address of the folder containing the file you want to copy. Then press ↵ Enter.
    • For example, to instruct the terminal to search for your file in the Desktop folder, tap cd Desktop in the terminal.
    • Make sure to capitalize the folder name if necessary.
    • If you get an error after typing in the location of a folder, then enter the entire address of the folder here (for example / home / username / Desktop / folder name) instead of alone folder name.
  3. Type in the copy tag. This is cp with a space after it.
  4. Enter the name of a file. Tap after cp and the space in the name and extension of the file you want to copy and put a space after it.
    • For example, if you want to copy a file called "hello", you would type cp hello in the terminal.
    • If the file name has an extension (for example ". Desktop"), make sure to also use the extension when entering the file name in the terminal.
  5. Enter the folder where the file is to be copied. Type in the address of the folder where the file is to be copied.
    • For example, if you want to copy the file "hello" to a folder named "Hi" that is in the Documents folder, tap cp hello / home / username / Documents / Hi in in the terminal.
  6. Press ↵ Enter. Doing this executes the command. The file is pasted into the specified folder.

Method 2 of 2: Using the user interface

  1. Consider using keyboard shortcuts. As with almost all operating systems that have a user interface, you can use keyboard shortcuts in Linux to copy and paste files:
    • Click on the file you want to copy to select it or click and drag your mouse over multiple files to select them all.
    • Press Ctrl+C. to copy the files.
    • Go to the folder where you want to copy the files.
    • Press Ctrl+V. to paste the files into the folder.
  2. Find the file you want to copy. Go to the location of the folder to be copied.
  3. Select the folder. Click on the folder to do this.
  4. Right click on the folder. A drop-down menu will now appear.
    • In some Linux versions there is also a menu bar at the top of the screen. If so, you can just go on edit instead of right-clicking on the selected file.
  5. click on To copy. This is in the drop-down menu and you copy the selected file with it.
    • In some versions of Linux, you click To copy... or Copy file.
  6. Go to the folder where the file is to be copied. Find the folder where you want to paste the file.
  7. Right-click on an empty space. A drop-down menu will now appear in the folder.
  8. click on To stick. This is in the dropdown menu and you paste the copied file into the folder.

Tips

  • If you want to move a file to another folder instead of copying it, type pl instead of cp when you enter the file name and location you want (for example mv hello Documents).
  • Through Ctrl holding down and clicking files select all the files you click on. By right-clicking on one of the selected files and then on To copy clicking copy all selected files.

Warnings

  • Not all versions of Linux have a user interface. If you can only use command lines in your version of Linux, then you must use the "cd" command to copy your files.