From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Copy files and dirs

Copy files and dirs - Linux Tutorial

From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Start my 1-month free trial

Copy files and dirs

- Everyday file management requires us to copy files and directories. We can do these tasks from the GUI, but they're usually faster on the command line. The command we use to copy files on Linux is CP. The syntax for CP is CP [Options] <source> <destination> The options can take the form of single letters preceded by a hyphen, or complete words preceded by two hyphens. If they are single letters, they can be combined into one sequence. For instance, - pf. The source file is the path to the file you want to make a copy of. If you want to copy multiple files, just separate them with spaces. You can also use file "globbing"- covered in this course- to match multiple files. The destination is where you want the file copied to. Both source and destination paths can either be relative paths, or absolute paths. Relative paths are relative to where you are. Absolute paths start with a forward slash and are from the…

Contents