From the course: Unix Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Copying files and directories - Unix Tutorial
From the course: Unix Essential Training
Copying files and directories
- [Instructor] Let's learn how to copy files and directories in Unix. Just like we did with move, we're going to be doing that from the command line. In the last movie, we moved a lot of our files into the my_project directory. If I type ls -l, we'll see what those are. You can see I've got several files that are in here as well as a couple of directories. Let's start by trying to copy this file right here, file_second.txt. The way we're going to do that is with the cp command, short for copy. Just like we had mv for move, we have cp for copy. We'll use a space and then we'll take any path to the target that we want to copy. The file we want is in the current working directory, so we can just type its name, file_second.txt. But we could easily provide a path to a file that was somewhere else, either an absolute path or a relative path. And then we want to put the target. Where do we want to copy this file to? Again…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
File system basics7m 24s
-
(Locked)
Creating files4m 4s
-
(Locked)
Reading files5m 7s
-
Creating directories3m 10s
-
(Locked)
Moving and renaming files and directories5m 43s
-
(Locked)
Copying files and directories5m 10s
-
(Locked)
Deleting files and directories2m 53s
-
(Locked)
Creating symbolic links5m 21s
-
(Locked)
Searching for files and directories4m 11s
-
(Locked)
-
-
-
-
-