cp
Program: cp
Copies files and directories.
Usage
cp [OPTION]... SOURCE... DEST
Description
Make DEST a copy of SOURCE. If DEST is a directory, put a copy of every SOURCE into it. Directories only with -r.
Options in the simulator
28 more options of the real program, not in the simulator yet
Examples
cp notes.txt Documents/notes-copy.txt
ls Documents
'Holiday 2027.txt' letter.txt notes-copy.txt notes.txt recipes.txt cp -r projects/website projects/website-backup
ls projects
website website-backup cp notes.txt notes.txt.bak
cp -r projects/shop shop.bak
ls shop.bak
README.md app.conf build.log releases test.log
cp -p notes.txt keep.txt
ls -l notes.txt keep.txt
-rw-r--r-- 1 lerner lerner 76 Oct 17 08:15 keep.txt
-rw-r--r-- 1 lerner lerner 76 Oct 17 08:15 notes.txt cp -i todo.txt Documents/notes.txt
cp: overwrite 'Documents/notes.txt'? n
head -n 1 Documents/notes.txt
Buy milk Where you learn it
Lessons
- Copying, moving and renaming Terminal start
- Copying, moving and renaming Terminal start
- Create, copy, move Linux Basics, Module 2: Files and directories