@hari_beta
Linux Oct 16, 2026

renaming a folder from the linux terminal

Simple one but I keep getting it wrong. I want to rename a directory called old_project to archive. What's the right command, and does it matter if the folder still has files in it?
1

Leave A Reply

Log in to post an answer.

1 Answer

hari_beta
There's no separate rename for this, you just move it to the new name: mv oldname newname If the name has spaces, quote it: mv "my old folder" "new folder". The one that catches people: if a folder called newname already exists, mv puts oldname INSIDE it instead of renaming. Use mv -i if you want it to ask before overwriting anything.