Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
DESCRIPTION
rename will rename the specified files by replacing the
first occurrence of from in their name by to.
For example, given the files foo1, ..., foo9, foo10, ...,
foo278, the commands
rename foo foo0 foo?
rename foo foo0 foo??
will turn them into foo001, ..., foo009, foo010, ...,
foo278.
And
rename .htm .html *.htm
:
will fix the extension of your html files.
SEE ALSO
mv(1)
1 Januari 2000 RENAME(1)
(END)
---------------------------------------------
1.januvari is january
2.what is the mv connection??
3.does this thread deserve to be such a long one??(when there are lots of other "Ghost" threads which seems 'never to get answered')
All Im saying is that mv should have been designed to be consistent whether you are dealing with 1 file or multiple files.
If a multiple file move requires a directory for the second argument, then moving a single file should be the same.
Renaming multiple files can wreak just as much havoc on a system as moving them. If you make a mistake on a rename command your system can wind up just as broken as it would if you made a mistake on a move command.
Originally posted by oopicmaster All Im saying is that mv should have been designed to be consistent whether you are dealing with 1 file or multiple files.
If a multiple file move requires a directory for the second argument, then moving a single file should be the same.
Renaming multiple files can wreak just as much havoc on a system as moving them. If you make a mistake on a rename command your system can wind up just as broken as it would if you made a mistake on a move command.
if you want the dos style syntax because you can't wrap your brain around the unix way, this was posted earlier.
Originally posted by oopicmaster All Im saying is that mv should have been designed to be consistent whether you are dealing with 1 file or multiple files.
If a multiple file move requires a directory for the second argument, then moving a single file should be the same.
Renaming multiple files can wreak just as much havoc on a system as moving them. If you make a mistake on a rename command your system can wind up just as broken as it would if you made a mistake on a move command.
I think what is being missed is that an asterix "*" is expanded by the bash shell to pass sall matching files to the program as arguments. Therefore it is not the program that sees the * it is the shell you are working in. I hope that makes things a bit clearer for you.
Originally posted by oopicmaster All Im saying is that mv should have been designed to be consistent whether you are dealing with 1 file or multiple files.
If a multiple file move requires a directory for the second argument, then moving a single file should be the same.
"should" is kind of a useless stance when it comes to Unix commands. either get over it and learn how to use the command, or use windows. or program your own OS.
let me ask you guys a question?What would asteric(*) represent in target file.i think
Code:
sh-2.05$ ls
abc.abcd
sh-2.05$ mv abc.abcd *.abcd
mv: `abc.abcd' and `abc.abcd' are the same file
sh-2.05$ mv abc.abcd b *.abcd
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
sh-2.05$ mv abc.abcd b*.abcd
sh-2.05$ ls
b*.abcd
this means an asteric in target file will not be replaced with something else.i.e,a terget file abc*.txt is a single file with the name abc*.txt.and you cant copy a number of files into a single file.got it??
Originally posted by defcon8 fsck off you n00bass fsck that cant be assed to RTFM you shouldnt even view such elite things compared to your inferiority
Please try to stay on topic. We are here to help people not belittle them.
Originally posted by arunshivanandan this means an asteric in target file will not be replaced with something else.i.e,a terget file abc*.txt is a single file with the name abc*.txt.and you cant copy a number of files into a single file.got it??
yeah, the * ceases to act as a wildcard when it's in the destination file. so that is very literal and logical.
I am sure that once you actually learn something you wll find the nix world to be way more versatile than your previous OS.
I doubt it.
The nix world was, is, and always will be, outside of mainstream computing.
Mainly due to the fact that nix savvy technical folk, are WAY too conservative
The PROBLEM that Linux has introduced is the attempt to move the nix world into the world of mainstream home computing.
It aint gonna happen as long as there are legions of ultra conservative nix users around who believe that the CURRENT nix way of doing things is the ONLY way they should be done.
Plain and simple.
The design of the mv command is a mistake when it comes to home computing. It should be corrected or eliminated.
Quote:
Actually if you want to get specific about the comparison between cp and mv commands, the way mv writes, i dont think that the file is actually copied from one location to another, and then deleted. the data isnt actually moved around on disk unless you move it to /usr/local, or another partition that you have set up besides your root one. it has more to do with where the file points to on disk, and not just that its in a different directory....hence why you need to defrag once in a while
This statement references the underlying IMPLEMENTATION detail of copy/delete vs. mv.
This argument is completely irrelevant!
Why?
Because to the end user the the end result of a copy/delete vs mv is THE SAME.
The end user doesnt care whether an actual "File Copy" has occurred or not.
In otherwords, if mv is embedded into cp... (which I think it should be) The user doesnt care how the underlying implementation actually moves the file.
By having 2 separate commands you force the user to learn 2 separate commands.... Not good.... users want to only learn 1 command, not 2.
SO....
If Linus is listening...
You want to improve Linux?
Get rid of mv!
oh yeah, and while you are at it.... get rid of rmdir too... Kay?
Great!
Now all I have to learn is 2 commands insead of 4.... Thanks...
Well I tend to agree it is complicated. The basic reason is-
Programmers had just created their own commands at will - there are stocks and stocks of them. Basically more people heard about a particular way to do things and it is still used.
You will find there are many ways to do the same thing.
Just pick which one suits you. There are tonnes of shortcuts. However when scripting [keeping in mind corporations administration] certain comands will allow for better maneuverability for parameters and attaching them to other commands. This has also kept certain commands alive. So it is worth getting familiar with each variant - even tho it may not be a shortcut for a simpler task at times.
And there's only one thumb up for windows - the fact that Gates got every farmer and his dog on a computer. I respect him for that - even though it is not the best OS - he dragged and enticed the general population into the compouter age. People should give them their credit.
Do I like Windows? Not really - I prefer to get everything working on a more versatile and stable [when configged] OS. I don't like 'em, don't hate 'em.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.