From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Move and rename files and dirs - Linux Tutorial
From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)
Move and rename files and dirs
- [Instructor] When Linux copies a file, it copies the file data blocks to a new location on the disk. 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 treats the file differently. If we have a file at /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 file's location in the file system. This is very fast because no data is actually being moved on the disk. 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
File globbing and parameter expansion4m 51s
-
(Locked)
Understand filesystem paths4m 28s
-
(Locked)
Create files and dirs5m 18s
-
(Locked)
Copy files and dirs5m 48s
-
(Locked)
Move and rename files and dirs4m 59s
-
(Locked)
Remove files and dirs6m 2s
-
(Locked)
Create links to files and dirs4m 55s
-
(Locked)
-
-
-