[Next] [Up] [Previous] [Contents]
Next: Deleting files and Up: First Steps into Previous: Copying files

Moving files

A new command named mv moves files, instead of copying them. The syntax is very straightforward.

/home/larry/foo#mv termcap sells
/home/larry/foo#ls -F
bells sells shells
/home/larry/foo#

Notice how termcap no longer exists, but in its place is the file sells. This can be used to rename files, as we have just done, but also to move a file to a completely new directory.

-to Note: mv and cp will overwrite the destination file (if it already exists) without asking you. Be careful when you move a file into another directory: there may already be a file with the same name in that directory, which you'll overwrite!


mdw@sunsite.unc.edu