Viewing and Changing the File System
Learn to manipulate directories and files from the command line.
StartKey Concepts
Review core concepts you need to learn to master this subject
cp
Copy
cp
Copy
$ cp file1 file1_copy
$ cp file1 file2 destination_folder
The shell command cp
is used to copy files or directories.
The basic argument structure is cp source destination
, where the source
is the file/directory to copy to the destination
file/directory.
Manipulation
Lesson 1 of 1
- 1So far we’ve used the command line to navigate the filesystem. We can view directories and files with more detail. We can also use the command line to copy, move, and remove files and directories….
- 2The ls command lists all files and directories in the working directory. We can use ls as is, or attach an option. Options modify the behavior of commands. For example: ls -a The command abov…
- 3$ ls -l drwxr-xr-x 5 cc eng 4096 Jun 24 16:51 action drwxr-xr-x 4 cc eng 4096 Jun 24 16:51 comedy drwxr-xr-x 6 cc eng 4096 Jun 24 16:51 drama -rw-r–r– 1 cc eng 0 Jun 24 16:51 …
- 6To copy multiple files into a directory, use cp with a list of source files as the first arguments, and the destination directory as the last argument. Here, we copy the files file1.txt and **f…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory