Select Page

ABIOLA RASP – Raspberries for African School Projects

Wie können wir helfen?

< Alle Themen
Print

Copy operations

no-809 au-03

Copy the contents of file

You can copy the file with cp command. cp copies the content of the file to another file.

1) The file that will be copied the content of

2) Run below command to copy to another file

cp abiola.txt new.txt

3) Here is the new file

FORMAT:
cp file1 file2

file1 = abiola.txt
file2 = new.txt

Copy the directory

r parameter need to be used to copy a directory to new directory. Please check below screenshot.

1) The directory that we want to copy to another directory.

2) Run below command to copy it recursively.

cp -r Abiola/ /home/pi/Documents/

FORMAT:
cp -r dir1 dir2

dir1 = Abiola/
dir2 = /home/pi/Documents/

Copy a file to directory

You need to type a directory to copy the file to the directory.

1) The file that will be copied

2) Run below command.

cp abiola.txt /home/pi/Documents/

FORMAT:
cp file dir

file = abiola.txt
dir = /home/pi/Documents/

This article is a component of the “Linux Introduction” course from the ABIOLA online Academy.

Please refer: https://abiola-academy.eu/courses/linux-introduction/?lang=en

Zurück Move a file
Weiter Show the current directory
Inhaltsverzeichnis