What is the logic behind the mv command

General chat concerning linux or linuxzoo.

Moderator: drgrussell

What is the logic behind the mv command

Postby purpleriverboy » Wed Feb 17, 2010 1:59 pm

When i want to rename a file say 'myfile' to 'newfile'....i have to execute the following command..

$mv myfile newfile

but i dont understand the hidden logic behind this.
I mean, if a command says
'move'
, why does it '
rename
' a particular file or directory.
purpleriverboy
 
Posts: 7
Joined: Mon Oct 19, 2009 7:36 pm

Re: What is the logic behind the mv command

Postby drgrussell » Tue Feb 23, 2010 12:16 pm

The "mv" command can do both renaming and moving.
There is often now a command called "rename".
Back in history, frequently used commands were usually just 2 characters long, so I support "mv" was easier to remember than "re".
drgrussell
Site Admin
 
Posts: 240
Joined: Sat Feb 12, 2005 8:57 pm


Return to Linux Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron