bold typeneeds to be replaced by text of your own, for example your own username, or the name of one of your files.
Everything else should be typed literally as given in the examples, using lower- and upper-case as shown. (Almost everything in Unix is in lower-case.)
At the end of each command you must press the Return key.
cp oldfilename newfilenameeg
cp file1.html file2.html
cp filename dir-nameeg
cp file1.html public_html
This will make a copy of
public_htmldirectory (assuming the directory exists).
mv filename dir-name
cpcommand makes a copy of the file with the new name or in the new location, and leaves the original file in place. If you use the
mvcommand the file is moved, so the original is deleted and the only copy is the one in the new location.
mvcommand can also be used to rename a file while leaving it in the same directory.
mv oldfilename newfilename
cp filename ..or
mv filename ..
Note the space before the two dots. The two dots represent the parent directory.
cp ../filename .or
mv ../filename .
The dot at the end of these commands stands for the current directory. Note that there is a space in front of this final dot.
public_html, and within
public_htmlyou have a sub-directory called
If you are currently in your home directory you can copy (or move) a file from your home directory into this sub-sub-directory with the following command:
cp filename public_html/personalor
mv filename public_html/personalor if you wanted not only to move the file into the different directory, but also to give it a different name you could use this command:
mv file1.html public_html/personal/file2.html
3rd May 1997
|Simple Unix commands: contents page||IT training page|