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 ...

Get SAMS Teach Yourself Unix in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.