Can the 'mv' command be used to rename a directory?

QuestionsQuestions8 SkillsProBasic Files OperationsAug, 02 2025
0172

Yes, the mv command can be used to rename a directory. The syntax is similar to renaming a file. Here’s an example:

mv old_directory_name new_directory_name

In this command:

  • old_directory_name is the current name of the directory (the source).
  • new_directory_name is the new name you want to give the directory (the destination).

After executing this command, the directory will be renamed accordingly.

0 Comments

no data
Be the first to share your comment!