For this exercise, you can test the commands in the shell-lesson-data/data
directory.
In the example below, what does cp
do when given several filenames and a directory name?
$ mkdir backup
$ cp amino-acids.txt animals.txt backup/
In the example below, what does cp
do when given three or more file names?
$ ls -F
amino-acids.txt animals.txt backup/ elements/ morse.txt pdb/ planets.txt salmon.txt sunspot.txt
$ cp amino-acids.txt animals.txt morse.txt
cp
copies the files to the named directory.
If given three file names, cp
throws an error, because it is expecting a directory
name as the last argument.