From the course: Linux CentOS 7: Files and Permissions

Unlock the full course today

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

Copy files and dirs

Copy files and dirs - Linux Tutorial

From the course: Linux CentOS 7: Files and Permissions

Start my 1-month free trial

Copy files and dirs

- [Instructor] 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 space options space source space 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, dash 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 root or top level directory. You can combine relative…

Contents