mv

The command that moves files and directories, which is also how you rename them.

It replaces an existing destination file without asking unless -i or -n is given.

In more detail

Within one filesystem a move only changes the name, so it is instant even for huge files. Like cp, it overwrites an existing destination without asking unless you add -i or -n.

Examples

mv draft.txt final.txt
mv -n source.txt dest.txt

Related terms

Taught in

References

Certification courses