[Top] [Prev] [Next]

mv - rename/move files

mv fromfile tofile 
mv fromfile... todir 


The mv command can be used in several ways.

If there are two arguments of the same type (directories or files) then mv will rename the fromfile to tofile.

For files, a previously file named tofile will be (silently) removed. This requires write permission for the current directory. Write permission is not needed for tofile.

For directories, a previously existing directory named todir will be (silently) removed if empty, and the mv operation will fail.

If the last argument is a directory, the earlier arguments (all files) will be moved into that directory. Any previously existing files of the same name will be overwritten.


Directories cannot be renamed or moved into other directories.

See Also
stat, fstat, fwstat, wstat - get and put file status in Chapter 8

remove - remove a file in Chapter 8

[Top] [Prev] [Next]

Copyright © 1996,Lucent Technologies, Inc. All rights reserved.