How To Move a File in Linux: Simple Commands and What Affects Them

Moving a file in Linux sounds straightforward, and most of the time it is. But there are a few details that change how you should do it: where the file is, what permissions you have, whether it’s on the same disk, and whether you care about keeping history or backups.

This guide walks through the basic ways to move files in Linux, explains what’s really happening under the hood, and points out the variables that make your situation a bit different from someone else’s.

The Basics: The mv Command for Moving Files

On Linux, you move files primarily with the mv command (short for ���move”) in the terminal.

The simplest pattern is: