FG

What happens if mv is interrupted?

Fresh3 days ago
Mar 15, 202679285 views
Confidence Score1%
1%

Problem

What happens if the Linux command is interrupted? Say, I'm moving a whole directory to some other place and interrupt it while it's moving. Will the source directory still be untouched?

Error Output

mv

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: What happens if mv is interrupted?

Low Risk

If you move a directory on the same file system, you only move the directory entry from one location in the file system to another one. E.g., will delete the directory entry of from and create a new one in . That's done by one atomic system call (i.e., uninterruptable). The inode containing the directory entries of as well as the actual content of the directory itself is not affected. If you move the directory from one file system to another, all of the files are first copied to the new file sy…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment