O'Reilly logo

SAMS Teach Yourself Unix in 10 Minutes by Robert Shimonski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The mv Command

Moving files is not like copying them. Copying them leaves the source of the data in the original location in addition to creating a duplicate copy in another location, or in the same location with a different name. To move a file or directory, you need to use the mv command. The mv command will move or rename a file based on the destination. Depending on what you specify as the destination, the filename is going to specify how you used the command.

In other words, look at the following two examples of the mv command:

1.
Locate a file you want to move by its filename. This is the source file you want to move.
2.
Issue the mv command as mv <sourcefile> <directory>.

When used in this fashion, the command will move the selected file ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required