How to Rename Directories

When renaming directories, you use the mv command exactly the same way as with files:

mv dir1 dir2

When dealing with directories, mv works a bit like cp does. If dir2 doesn't exist, the above will rename dir1 to dir2, but if dir2 exists, the directory dir1 will be moved into the dir2 directory under the name dir2/dir1.


No comments:

Post a Comment