Copying and moving files

Warning: If you have not noticed, entering at least one space between each part of a command is important. Pay close attention to the spacing and the usage of a period (.) in the following command.

At this point in the tutorial, you should be in the following directory
/home/students/loginname/csc1710/assign1

You may verify this with the pwd command. If you are not in the correct directory, please go BACK and make corrections.

Now you need to copy a file from me. Issue the command

cp /home/faculty/rshore/sample.1710 .

and yes, a space followed by a period is part of the command! The period says to copy the file sample.1710 from my directories to the current subdirectory (assign1). So, now we know that a single period (.) refers to whatever subdirectory your currently sitting in, and a double period (..) refers to the parent or subdirectory "above" you.

This command copied the file sample.1710 from my directories into yours - now you have a copy of the file. (Go ahead, list your files just to be sure.) Let's rename the file with the command

mv sample.1710 first.cpp

This renames the file sample.1710 to first.cpp. (Go ahead, list your files just to be sure.)


Move on to NEXT, go BACK, or return to START.
Mr. Roger Shore
rshore@linus.highpoint.edu