HOME > Linux > Linux: Copy File - How To Duplicate Data

Linux: Copy file - how to duplicate data

If you want to copy files or directories in Linux, this works, unlike in Windows, via a command. To execute the command, you need to type it into the Linux terminal. Even though the copying process is just as simple in Linux as it is in Windows, there are still a few little things to keep in mind.

This is how you copy data in Linux

You can copy as many files as you like at the same time, but you can only ever specify one directory as the destination, multiple ones won't work.
  1. Open the terminal using the key combination [Ctrl] + [Alt] + [T].
  2. Now enter the copy command. The command is always structured according to the same scheme: cp [options] [sources] [destination].
  3. Confirm the input with [Enter].
For [sources], enter the name of the file or directory you want to copy. Multiple files or directories are separated by a space, for example like this: "Image1.jpg Image2.jpg".Instead of [Destination], specify the directory to which the data should be copied, like this: "home/username/images"

The most important copy options at a glance

For [Option], you have a variety of options to modify the copy command.
  • -b, --backup: Die kopierten Dateien werden, bevor Sie überschrieben werden, zwischengespeichert.
  • -i, --interactive: Wird eine Datei durch den Kopiervorgang überschrieben, wird eine Bestätigung eingefordert.
  • -n, --no-clobber: Mit dieser Option werden keine vorhandenen Dateien überschrieben.
  • -s, --symbolic-link: Anstatt einer Kopie der Dateien wird ein Link beziehungsweise ein Verweis zu den Daten erzeugt.

By Cleavland

Tidal: How much Mbit? You need to know :: Alexa doesn't understand me - here's what you can do about it
USEFUL LINKS