From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 1 Deploy, Configure, and Manage (2021)

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Move files and directories

Move files and directories

- [Instructor] When Linux copies a file it copies the file data blocks to a new location on the disc. When moving a file between file systems, Linux copies the data blocks to the new location and then deletes the original data blocks. If however the source and destination are on the same file system, Linux trees the filed differently. If we have a file that /home/bob/file1.txt and we want to move it to /home/ted we'd use the move command or mv command. Since both of these locations are on the same hard drive, Linux just updates the files location in the file system. This is very fast because no data is actually being moved on the disc. We can also move a file from a directory to the same directory as long as we specify a different name. If we move /home/ted/file1.txt to /home/ted/file2.txt it effectively renames it. This is why we use the mv command to rename files in Linux. The syntax for move is mv which is the…

Contents