Suppose the spelling of mickey.txt has been mis-spelt as mick.txt , then renaming can be done by the "mv" command. The sample syntax and usage is as given below.
The "mv" command is also used to move files from one location to the other.
Syntax: mv <old_file_name> <new_file_name>
$ mv mick.txt mickey.txt
$ mv mick.txt mickey.txt
The "mv" command is also used to move files from one location to the other.
Hi Abhi,
ReplyDeleteso
Basically there no direct command or rule for renaming a file or folder in linux?
So the rule is to replace the file with mv commamd with different name at same location will do the work of renaming a file or folder!!
Thanks anand for reading my post! As per my knowledge there's no command that does renaming. The closest that comes is the "rename" command whose syntax goes like this - rename . It is used to rename multiple files in one go...
DeleteI will write about this command once I learn more about the perl regular expressions