Moving Files with mv

Moving directories and files means moving them from one location (think of location as an absolute file path, like /home/ejr/aFile) in your system to another location (say, /temp/File or /home/ejr/AnotherFile). Essentially, you have only one version of a file, and you change the location of that version. For example, you might move a directory when you’re reorganizing your directories and files. Or, you might move a file to rename it—that is, move a file from one name to another name.

You move directories and files using mv, as shown in Code Listing 2.8.

To move a file or directory:

1.
ls To begin, use ls to verify the name of the file you want to move. If you’re changing the name of the file, you’ll want to ensure that ...

Get Unix Third Edition: Visual Quickstart Guide 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.