How to rename a file or directory

in command line, file commands, newbie

There is no rename function in Ubuntu Linux.

Instead, you simply move the file, giving it a new name. If you don’t actually mv it to another directory, then you have effectively renamed it:

mv file_name_original file_name_new

If you are trying to rename a directory, you need to use the -r recursive flag:

mv -r original_dir_name  new_dir_name

Related posts:

  1. How to move or copy a directory I was trying to copy a directory, and I kept getting a cryptic error: cp:...
  2. How to easily view the end of a log file Ubuntu/Linux log files can be quite long with many entries, but usually you only care...

Leave a Comment

(will not be published or spammed)

*


Previous post:

Next post: