I tried renaming a file in Ubuntu



  • @blakeyrat said:

    Who designed this mess? Why would you conflate two wholly unrelated commands into one? What the FUCK were they thinking?

    Um...well, as a result of this blakeyrant, I just discovered the existence of the REN command. I'm pretty sure I'd always used MOVE to rename files on Windows or DOS (yes, it can do that there too), or Move-Item in recent years (apparently Rename-Item also exists).

    I guess it has always made sense to me (at least for as long as I can remember) because I thought of the filename as part of the location the filesystem understood as "where to look for the bits comprising this file" at least as much as it was a property of the collection of bits that actually WERE the file...or perhaps I got in the habit of thinking of filenames that way because it explained why I could "move" a file from one name to another, instead of having to open the file to change its name. But I can see how, if I'd discovered the REN command first and the ability of the MOVE command to rename things later, it might have seemed less logical.



  • @powerlord said:

    "sudo apt-get install nginx" has worked on Ubuntu for several years at least.

    I'm having deja-vu.

    What's with all of these packages that have both a "easy" and "fucking hard" method to install always putting the "fucking hard" one in their directions?



  • The "fucking hard" one has to be OS agnostic.



  • @stinerman said:

    The "fucking hard" one has to be OS agnostic.

    Except they aren't. Those directions won't work on Windows, for example-- they have to put Windows in another section. And it won't work with Linux distributions that don't have apt-get installed, I believe some of those are still popular.



  • @flabdablet said:

    The rename that comes with Ubuntu and other Debian derivatives is Larry Wall's perl rename, which is more flexible though a little more cryptic than the one described above (it uses a Perl substitution command to describe what to do to the selected filenames). Its first Debian appearance was in Potato, released in 2000.
    Thanks. It's been around for a while, but I never stumbled across it before. It's not likely I'd have found it by accident, since I'm far, far more likely to inadvertantly type a UNIX command in a Windows command shell than type a DOS command in a UNIX shell.

    FWIW, Cygwin has the non-Perl version described above. Centos (a RedHat derivative) has a similar one, but without any options (not even -h), and with a very terse, less-than-helpful error message. WTF.

     



  • I know it's local policy to bash blakeyrat, but I think he's completely right about the Linux (Unix) command line. The command names have no logic or consistency whatsoever (take "halt" vs "shutdown"), and in many occasions a common word that everyone would expect to do something simple ("time" and "rename" would be the best examples, but there are more) gets assigned to some obscure script that's rarely needed, whereas basic tasks get completely arbitrary names and/or completely cryptic argument syntax ("tar", "find" or the goddamn fucking "ps"). 

    I'm a big fan of standards and compatibility, but it doesn't hurt to think "OK, let's scrap everything we have and design a new syntax from scratch, using what we have learned this time", say, once every 40 years.



  • @anonymous234 said:

    I know it's local policy to bash blakeyrat, but I think he's completely right about the Linux (Unix) command line. The command names have no logic or consistency whatsoever (take "halt" vs "shutdown"), and in many occasions a common word that everyone would expect to do something simple ("time" and "rename" would be the best examples, but there are more) gets assigned to some obscure script that's rarely needed, whereas basic tasks get completely arbitrary names and/or completely cryptic argument syntax ("tar", "find" or the goddamn fucking "ps"). 

    I'm a big fan of standards and compatibility, but it doesn't hurt to think "OK, let's scrap everything we have and design a new syntax from scratch, using what we have learned this time", say, once every 40 years.

    You'd think that people would do things like that, but that would require people in the linux community to actually be wiling to change things ever.



  • @blakeyrat said:

    @joe.edwards said:
    Your complaint is you don't like the name of the command? Just shove alias ren="mv -T" in .bashrc.

    Renaming a file and moving a file aren't the same operation. So you end up with strange-ass system where "move" can result in a different file name (WTF!??!) and "rename" can result in the file ending up in a different directory (WTF!?!?!). Plus the mnemonic (or "gnemonic" according to Ubuntu) is totally worthless for renaming a file. Why would anybody think of "move"? (Much less "mv"?)

    Who designed this mess? Why would you conflate two wholly unrelated commands into one? What the FUCK were they thinking?

    Yawn.


    User doesn't read the manual, and tries to type something which might mean something to him, but doesn't mean anything to the computer, then complains.


    Really, "mv" makes a lot of sense to me -- rename the file and/or put it in another directory. One command for all these operations (and it also includes renaming and moving directories, and renaming and moving sets of files).

    If you think "mv" is too short, try typeing something like "I-Want-to-rename-the-following-file" as a command often enough, and you'll get the idea why "mv" makes sense.



  • @blakeyrat said:

    Renaming a file and moving a file aren't the same operation.
     

    Conceptually, they are - which is why you could use "ren.exe" in DOS to move a file to another location, and "move.exe" to rename a file in the same location.

    The "mv" command is the one you're after:

    mv index.php info.php

    The "rename" command is used for batch-changing several files, for example:

    rename s/\.php$/.html/ old*.php

    - will change old1.php -> old1.html, old_file.php -> old_file.html, etc.



  • @blakeyrat said:

    Serious question:

    What is the best way to deploy a website to a Linux web server?

    I could either set the web server up as a Git client and log into it and do a git update or whatever git's name for that command is

    That's my preferred option. I don't know Git, but the advantage of a CVS is that you've the opportunity to roll back to earlier versions if a deployment goes bad, and you can also script the deployment to automate it.

    @blakeyrat said:

    or I could set up a SFTP server and user account and we could SFTP the files to the server... the latter seems like it better separates the development process from the deployment process, and seems to be how (almost) all Linux server providers work.

    If you've got SSH running on the box you've already got SFTP.  The difference is you're pushing from a source and you'll need to keep track of which files have been pushed over - in most cases, people automate the SFTP "push". It's not really all that different from the Git "pull".

    @blakeyrat said:

    How do you keep track of application-specific configuration on Linux webservers, since they don't seem to have anything like IIS' web.config file? What if two applications have mutually-exclusive configurations?

    If you're talking Apache, there's an httpd.conf (or apache2.conf) but best practise is to separate out vhosts (what you'd call a "Web Application" in IIS) into separate config files, so the main config file contains refactored (global) settings then includes site-specific stuff that either appends to or overrides the global settings. It's not uncommon to find two different sites with conflicting directives sitting on the same server.

    In terms of keeping track of changes to configs (and consistent deployment of updates), Morbs suggested "muppet", which I've yet to setup and play with. But if you're not talking a huge number of servers and changes to config files are fairly infrequent (such as my case) I just rely on some SFTP scripts and directories of base+specific stuff. It's a bit of a Spectate approach, but for the number of servers I manage it's adequate.

     @blakeyrat said:

    I keep getting assigned this bullshit by my boss and I'm completely incompetent to handle it.

    Serious suggestion: look at installing WEBMIN on that box, then admin it via a browser (including a web-based filemanager that can rename and set permissions pointy-clicky). You may find that's easier and quicker for most (infrequent) stuff you need to do.

     



  • @HardwareGeek said:

    Indeed. I've rolled my own using foreach and mv countless times, because I've used *nix OSs for 30 years and never knew this utility existed. Anybody know how long it's been around?
     

    The original one that was written back in 2000 which has been superceeded by the perl version (which blakey used - hence the Perl-puking error message) in 2012.

    I only know this shite because I discovered it last week and read up about the differences between them:

    • The original 2000 version didn't check for the existence of target names so existing files were always clobbered.
    • The latter has an option that does a test-run and reports what would have changed (as well as having preg-style regex, not shell metacharacters)


  • @DescentJS said:

    @anonymous234 said:

    I know it's local policy to bash blakeyrat, but I think he's completely right about the Linux (Unix) command line. The command names have no logic or consistency whatsoever (take "halt" vs "shutdown"), and in many occasions a common word that everyone would expect to do something simple ("time" and "rename" would be the best examples, but there are more) gets assigned to some obscure script that's rarely needed, whereas basic tasks get completely arbitrary names and/or completely cryptic argument syntax ("tar", "find" or the goddamn fucking "ps"). 

    I'm a big fan of standards and compatibility, but it doesn't hurt to think "OK, let's scrap everything we have and design a new syntax from scratch, using what we have learned this time", say, once every 40 years.

    You'd think that people would do things like that, but that would require people in the linux community to actually be wiling to change things ever.

    I don't think it's possible to make large-scale changes in Linux. Linux is designed by a committee of 10s of thousands. So getting a decision will likely take a few more centuries.



  • @Buttembly Coder said:

    Thread synopsis:
    <font face="comic sans ms">

    • I have no idea how to copy a file in linux
    • This is all linux's fault! They should make every command work how I expect to
    • You use This Command, which can also do These Other Things
    • That's stupid, every command should only do one thing
    • No, you're stupid
    • OS dick-waving fight

    </font>
    plus one.


  • @Cassidy said:

    @blakeyrat said:
    Renaming a file and moving a file aren't the same operation.
     

    Conceptually, they are - which is why you could use "ren.exe" in DOS to move a file to another location, and "move.exe" to rename a file in the same location.

    No, conceptually, move and rename are two different things -- two entirely different concepts.  In real life you don't move something by renaming it, or rename something by moving it.

    But, on a computer, "under the hood" they are sort of the same thing.  When you "move" a file it doesn't actually go anywhere, it just gets renamed from <font face="courier new,courier">c:\somedirectory\somefilename</font>  to  <font face="courier new,courier">c:\someotherdirectory\someotherfilename</font>.  Which is why you can use "move' to "rename" a file.

    If the user wants to rename a file then there should be a <font face="courier new,courier">rename</font> command.  If the user wants to move a file then there should be a <font face="courier new,courier">move</font> command.  The fact that they are more or less the same thing, because of the way they are implemented in the code of the operating system, is irrelevant -- that's an obscure technical detail that the user shouldn't have to be concerned with.

     



  • @blakeyrat said:

    Last time we trusted a "Linux expert" at the company to set up a server, he fucked it up big-time-- I'm not a Linux expert, but I know when a server has zero back-ups, zero performance monitoring, zero redundancy, zero database indexes, etc. Even knowing jack shit about Linux, I was able to whip that server into (somewhat) decent shape.
     

    Quoted for fucking truth.

    It sounds like Blakey knows what to do to maintain a server, just don't fully know how to do it. The former expert may know how to do things, but clearly didn't know what they were supposed to do.

    When I teach Linux admin courses, I impose upon the importance of how to think and act like a sysadmin - understand your responsibilities to the business. It's one thing with knowing the commands, it's another thing to know when to use them and why.



  • @Cassidy said:

    When I teach Linux admin courses, I impose upon the importance of how to think and act like a sysadmin
     

    I other words, it's not your job to play Linux nerd and show off your CLP.



  • @El_Heffe said:

    No, conceptually, move and rename are two different things -- two entirely different concepts.  In real life you don't move something by renaming it, or rename something by moving it.

    But, on a computer, "under the hood" they are sort of the same thing.  When you "move" a file it doesn't actually go anywhere, it just gets renamed from <font face="courier new,courier">c:\somedirectory\somefilename</font>  to  <font face="courier new,courier">c:\someotherdirectory\someotherfilename</font>.  Which is why you can use "move' to "rename" a file.

    If the user wants to rename a file then there should be a <font face="courier new,courier">rename</font> command.  If the user wants to move a file then there should be a <font face="courier new,courier">move</font> command.  The fact that they are more or less the same thing, because of the way they are implemented in the code of the operating system, is irrelevant -- that's an obscure technical detail that the user shouldn't have to be concerned with.

    Thank you! It's so refreshing to know that some people fucking GET IT.



  • @El_Heffe said:

    But, on a computer, "under the hood" they are sort of the same thing.
     

    Yeah, that's what I meant. You're changing location/identity information about the file - whether you're changing the bit at the end (filename) or bits in the middle (directory path) it's the same to the OS. I probably used "conceptually" in the wrong context.

    @El_Heffe said:

    If the user wants to rename a file then there should be a <font face="courier new,courier">rename</font> command

    I think - historically - Thompson/Kernigan/Ritchie viewed it as the same operation and didn't bother coming up with another command. Fortunately, someone's now created a rename command for Linux. Unfortunately, it doesn't work in the simple manner as people expect.

    Double-unfortunately, there's two versions also.



  • @anonymous234 said:

    I'm a big fan of standards and compatibility, but it doesn't hurt to think "OK, let's scrap everything we have and design a new syntax from scratch, using what we have learned this time", say, once every 40 years.
     

    That's kinda the issue there: commands like mv, ps, ls etc were ones developed in the early days when 2-character commands were more memory-efficient. Later commands were developed by people who decided they didn't like the original syntax so went their own way ("find" and "tar" are two good examples of that).

    @anonymous234 said:

    take "halt" vs "shutdown"

    I thought "halt" called the shutdown command anyway - it was just a convenient alias. But then it differs between Unix flavours, so... consistency.. yeah.



  • @Cassidy said:

    Yeah, that's what I meant. You're changing location/identity information about the file - whether you're changing the bit at the end (filename) or bits in the middle (directory path) it's the same to the OS. I probably used "conceptually" in the wrong context.

    The filename isn't part of the file. If you have a .png of a rose, it's still a .png of a rose even if you rename it to "big_turd.png".



  • Todays top story: Apparently a 20 year old command is "incorrect".

    Sure...



  • @blakeyrat said:

    @joe.edwards said:
    Because you have a career using computers.

    Oh. Well I don't. And I take great pleasure in giving a thumbs-down to interviewees who have CS degrees but don't know shit. Which is most of interviewees with CS degrees.

    Maybe they're better now, but back when I was in college, the CS curriculum was totally useless.



    This explains much about Blakeyrat. He's not actually trained in nor interested in software development and feels both jealous of and resentful of people with real Computer Science degrees. It's why he's both so angry about open source tools being written for by and for developers AND completely unable to learn how to use the tools. When he preaches for more accessibility, it's not for some theoretical disabled person, it's for him, himself, because he just doesn't have the conceptual framework to grok the tools that are easily understand by those they were actually intended for.

     



  • I like the CLI for mundane tasks like file renaming and copying and I agree that "mv" to rename files is stupid. Fortunately for me this is the first time I've ever heard of a "rename" command, "mv" is the only one I knew of to rename files.



  • @Snooder said:

    He's not actually trained in nor interested in software development

    You read my posts here, do you honestly believe that is true?

    @Snooder said:

    and feels both jealous of and resentful of people with real Computer Science degrees.

    You read my posts here, do you honestly believe that is true?

    @Snooder said:

    It's why he's both so angry about open source tools being written for by and for developers AND completely unable to learn how to use the tools.

    That is demonstrably false.

    @Snooder said:

    When he preaches for more accessibility, it's not for some theoretical disabled person, it's for him, himself,

    It's for both.

    @Snooder said:

    because he just doesn't have the conceptual framework to grok the tools that are easily understand by those they were actually intended for.

    If you know to know the kind of person I am, here it is: I'd never use the word "grok".

    I'm assuming those tools were made for human beings. I'm one of those. I assume they're made for software developers. I'm one of those, whether you like it or not. I assume they're made for system administrators. I'm one of those, too. So in what way am I not who they were intended for?



  • @blakeyrat said:

    Renaming a file and moving a file aren't the same operation. So you end up with strange-ass system where "move" can result in a different file name (WTF!??!) and "rename" can result in the file ending up in a different directory (WTF!?!?!). Plus the mnemonic (or "gnemonic" according to Ubuntu) is totally worthless for renaming a file. Why would anybody think of "move"? (Much less "mv"?

    That's because bash does not have a rename command, because it's the move command with less usefulness, i.e. not worth having.



  • @DescentJS said:

    You'd think that people would do things like that, but that would require people in the linux community to actually be wiling to change things ever.
     

     

    YOU can do it, if you want it - apparently people in Linux comunity do not want to do it, as they are satisfied with the commands as they are. But (as difference from closed source) they still allow you to make changes, that you want. Even more - if such changes will be wanted by other people, then you can distribute such changes and satisfy them. If more people would love your way, then your way would became mainstream.

     

    But I do not know, how much you paid/contribute to linux community, that you feel, that the community should abadon its way and change things to work your way instead - I am afraid, I did not hear recently about somebody relativly unknown donating so much to linux community.


  • Discourse touched me in a no-no place

    @boomzilla said:

    @HardwareGeek said:
    @El_Heffe said:
    So Linux, or some variations of Linux, may not have a "rename" command that's actually built into the operating system, something that DOS 1.0 had 30 years ago.  That's the most retarded thing I've ever heard.

    Sure it does; it's just not called "rename." It's called "mv", because it can not only move a file from one name to another in the same location; it can move a file to another location, even across file system boundaries, with the same or changed name.

    Yeah, but you absolutely have to agree that it's embarrassing that the guys who created mv didn't have enough smarts to predict what DOS 1.0 would do ten years later.

    FWIW, on Windows 8, move acts like mv in that it can rename a file in place. I don't know how long that feature has been there.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    The embarrassing thing is that this bug has never been fixed in all those decades.

    No, in this case the embarrassing thing (assuming you're still talking about "move" having "rename" functionality) is that Windows does the same thing and you didn't know that.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    @joe.edwards said:
    You can have Apache look for .htaccess files within the web root if that's how you want to do it

    Ah, I know about .htaccess but I didn't know PHP could look for shit in there in addition to Apache itself. I've only seen it used for things like doing quick-and-dirty password protection of a directory, or overriding directory listing, or what-not.

    Nope, it's more that you use .htaccess in this case the way Windows uses the registry for file associations. You tell Apache that .php files should be run through the php executable. In the same way, you can tell it that Perl should process .pl files, and so on.

    ETA: I see, reading the rest of the thread, that I meant httpd.conf, not .htaccess. That's what I get for not using Linux in several years.



  • @gilhad said:

    YOU can do it, if you want it - apparently people in Linux comunity do not want to do it, as they are satisfied with the commands as they are.
     

    The problem is that those people have been using Linux for a long time, and you only really notice those things for the first days. The first time you find a weird interface or a program that fails to do what it's supposed to, you think "who the hell designed this shit", but the second time you just sigh and use it anyway, and when you've been using it for 5 years you can already operate it without thinking so you don't even pay attention to it, and any changes just seem to make it worse.

    This is one of the reasons why many industries tend to stagnate for long periods of time until somebody comes from outside and "revolutionizes" it simply by making something that's not shit (or by not charging obscene amounts of money for it).



  • So... the WTF is that you typed in a command without checking the documentation for what it did first?

    Allow me to submit for your perusal this search.

    In windows, if you try to rename a file, something is using the file, and I'm like "I'd paid for this?!". Well no, I didn't, because I use Ubuntu.

    I also use Windows, but I don't have to be happy about it.



  • @anonymous234 said:

    @gilhad said:

    YOU can do it, if you want it - apparently people in Linux comunity do not want to do it, as they are satisfied with the commands as they are.
     

    The problem is that those people have been using Linux for a long time, and you only really notice those things for the first days. The first time you find a weird interface or a program that fails to do what it's supposed to, you think "who the hell designed this shit", but the second time you just sigh and use it anyway, and when you've been using it for 5 years you can already operate it without thinking so you don't even pay attention to it, and any changes just seem to make it worse.

    This is one of the reasons why many industries tend to stagnate for long periods of time until somebody comes from outside and "revolutionizes" it simply by making something that's not shit (or by not charging obscene amounts of money for it).

     

    And again - YOU are the person, who want the change, so do it YORSELF. They are solving their problems with linux (like support for new HW or faster databases or ... whatever is their problems are) and they are not paid to solve your problems (especially if that would result to problems for them - nothing works like it used last ten or twenty years)

    So you are free to fork the Linux and make one, that would solve your problems - there are many ways to do it - fork the code and rename commands (and probabelly backport all new features as they hit mainstream), make your own distribution (maybe Newbix or Newbian) loaded with ton of aliasis and one-liner scripts, or any other way you can think of ...

    The problem is, that such  fork/distribution/whatever would attract only first-time users, which would still bombard you with requests, that they typed something and it not worked, how they expeted without reading documentation, but they would not help you with upholding your shiny Newbian. Second-time users would look for new features and solutions for their problems, then sight and migrate to distribution with more active developers (Debian/Gentoo/Slax/Redhat/...) at the cost of having it used one omre for first time. And on the reward of much larger developer base and much richer documentation, than you was able translate for Newbian.

     



  •  I have used Linux on and off for years.  Every time i use it i get the feeling it is designed by a moody spiteful teenager.  I can't believe organisations put up with Linux within the professional server environment.

    anonymous234 is correct - it is so common place now we just have to shrug and work with what there is.  I think Linux has held back human civilisation development  .. engineers and scientists fixing stupid bugs instead of computing new problems.



  • @blakeyrat said:

    Why would you conflate two wholly unrelated commands into one? What the FUCK were they thinking?

    probably something along the lines "Oh, hey, from the filesystem standpoint moving a file within the same partition is the same as renaming it! And even MS-DOS, and probably any other OS before and after it realize it too and do it the same way, so let's do it that way as well!"



  • Man, I'm sooooo tired of reading stupid ass rants like this that I'm starting to wonder if much more so called "IT" professionals are simply spoiled brats who their parents never told them what work is and that they sucked at everything they did.

    You're complaining about a set of tools that have been around for more than 30 years, that you don't even comprehend how they work and that your so self-impossed genius is above reading a single man page. Yes, Bash is broken, ugh! The terminal is so stupid, bah!

    I wouldn't have wasted my time answering your autodefensive post (because clearly you are the problem) if it wasn't because someone might read this and feel entitled to think in the same wrong way of blaming the tool for their incompetency.

    One last thing, it's not "Ubuntu", it's not Linux, it's not even whatever shell you're using (you probably don't even know, because, come on, you're a genius who can't afford to read), it's your incompetence which fails to rename a file.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    Serious question:



    What is the best way to deploy a website to a Linux web server?
    In your case, clearly the best way is to get someone who knows what they're doing, or is willing to learn, to do it. A Windows[tm] GUI[r] fanboi who refuses to learn CLI tools out of some misguided principle, or gets confuzzled at the word 'stanza' in documentation, is clearly not the right sort of person to be asked to do such a simple task as rename a file and then refrain from moaning to the nearest messageboard because he got the wrong command and CBA to RTFM.



  • @blakeyrat said:

    Renaming a file and moving a file aren't the same operation.
    They are in Linux and Unix; this sorta makes sense if you think of the entire path as the 'name'. The man page for mv has some language to the effect that moving a file is the same operation as renaming.

    The 'rename' command is intended to rename whole sets of files at once with a regular expression defining a tranformation to apply to the name of each file in the set (probably a directory).


  • Discourse touched me in a no-no place

    @blakeyrat said:

    I assume they're made for system administrators. I'm one of those, too.
    No, you're really not. You might like to pretend you play one on the internet, but this whole thread demonstrates why you really aren't a sysadmin.



  • @dhromed said:

    I other words, it's not your job to play Linux nerd and show off your CLP.

    Oddly, I don't get that many people wanting to wave their Linux wang. But I do get many IT nerds that don't understand they're employed to serve the business, not to feather their nest.



  • @blakeyrat said:

    The filename isn't part of the file.
     

    I'd have thought file metadata was part of the overall file contents.



  • @Master Chief said:

    That's because bash does not have a rename command, because it's the move command with less usefulness, i.e. not worth having.
     

    But that doesn't stop Blakey from downloading the bash source, appending a rename feature, recompiling and sitting back smugly in the knowledge that he's shaped it into what he requires!



  • @powerlord said:

    .htaccess (for Apache) or manually defining parameters directly in Apache's virtualhost for PHP is the only way to override any of PHP's main settings.
     

    Not strictly true - you can have a php.ini per-vhost.



  • @FrostCat said:

    Ah, I know about .htaccess but I didn't know PHP could look for shit in there in addition to Apache itself.
     

    Warning: the permitted directives in .htaccess are still governed by the main httpd.conf file, so you could drop shit in there and PHP (or Apache, more correctly) will still ignore it if the main config file doesn't specify those directives can be used with an AllowOverride directive.

    It's caught me out a few times - logfiles can be your friend on this one.



  • RE move vs rename: If I get it right, the two POVs are:

    • Various people: "name is part of the file path, so move and rename are really the same".
    • Blakey and El_Heffe: "Moving and renaming are two different things, and even if it's the same under the hood it means to have the same command for both is leaky abstraction."

    @blakeyrat said:

    @rad131304 said:
    As others have noted you take a performance hit when configuring your system in this manner. If you can control the entire instance of apache over doing folder specific configuration then you are much better off.

    Why doesn't Apache just ask the OS for notifications on those files, and only re-read the config if they change? Like IIS does? I mean... derp?

     

    Does nx even have file change notifications?



  • @HardwareGeek said:

    FWIW, Cygwin has the non-Perl version described above.
    Here's a native Windows port that seems to originate from an ancient util-linux package.
    @FrostCat said:
    FWIW, on Windows 8, move acts like mv in that it can rename a file in place. I don't know how long that feature has been there.
    Since move.exe was introduced on DOS 6?



  • @Master Chief said:

    That's because bash does not have a rename command, because it's the move command with less usefulness, i.e. not worth having.

    Because having more restrictions on what software can and can't do has never been a good idea, right?
    Oh wait, I forgot we were talking about a operating system where the primary data type used for inter-process communication is a fucking string.



  • @PJH said:

    @blakeyrat said:
    Serious question:

    What is the best way to deploy a website to a Linux web server?

    In your case, clearly the best way is to get someone who knows what they're doing, or is willing to learn, to do it. A Windows[tm] GUI[r] fanboi who refuses to learn CLI tools out of some misguided principle, or gets confuzzled at the word 'stanza' in documentation, is clearly not the right sort of person to be asked to do such a simple task as rename a file and then refrain from moaning to the nearest messageboard because he got the wrong command and CBA to RTFM.
    One of two things is true, blakey either:

    1. likes to feign ignorance and be intentionally obtuse or
    2. he posesses a sub-normal intellect bordering on the retarded (i.e. he can put sentances together but inferencing and higher level thought are beyond his capabilities.)
    As evidenced by his posts it can be difficult to discern which of the cases is correct, but if you can't tell the difference between the two aren't they kind of the same? If it looks like a retard, sounds like a retard, and acts like a retard, we can treat it as a retard even if it is just pretending to be a retard.


  • @El_Heffe said:

    @Cassidy said:

    @blakeyrat said:
    Renaming a file and moving a file aren't the same operation.
     

    Conceptually, they are - which is why you could use "ren.exe" in DOS to move a file to another location, and "move.exe" to rename a file in the same location.

    No, conceptually, move and rename are two different things -- two entirely different concepts.

    That depends entirely on your own conceptual framework, which in turn is strongly shaped by the tools you most frequently use. Personally I don't see files as analogous in any important way to people (for which moving and renaming are clearly different things) and am quite comfortable with the notion that "move" and "rename" are both about as close as terms with physical-space meanings can get to what you're actually doing when you mv or ren a file. You and Blakey are pretty clearly not comfortable with that notion. That, in and of itself, doesn't mean that either of us is justified in considering the other stupid or backward or Wrong.

    Programming languages have many useful counterparts in natural languages: in particular, command names are analogous to verbs. Complaining that mv and cp and ls and cd and grep and sed and awk are shitty verbs with unnatural semantics, and that this constitutes a lamentable deficiency in POSIX-like systems that only remains unfixed because of bloody-mindedness on the part of system developers, is about as pointless as complaining that Americans refuse to use the proper Mandarin words for things.

    If you don't speak a widely used language, your inability to communicate effectively in it is not because the language is broken - it's because you haven't put in the time and effort required to learn it. Analogously, expecting to sit down with an unfamiliar CLI and be instantly productive with it is completely unrealistic, and doesn't reflect at all on the inherent quality or usefulness of that CLI.

    It's also quite unreasonable to expect a CLI to display the kind of overt discoverability that GUIs were invented pretty much solely to implement. A CLI and a GUI are not the same kind of thing at all: a CLI is a language, and like every language, will reward effort expended acquiring fluency. The main strength of languages is that they allow for abstraction; GUIs, by contrast, are pretty much just point-and-grunt. They're a good way to get simple tasks done without thinking too hard, and that's about as far as they go. Whether you enjoy them or not, the fact remains that CLIs are the literate way to use a computer, and literacy is a generally useful skill to acquire.

    Also like natural languages, the fastest and easiest way to learn a CLI is to hang about with people who are already proficient with it, and graciously accept any help they offer rather than pissing and moaning about the fact that they know stuff you don't.



  • @FrostCat said:

    @boomzilla said:
    @HardwareGeek said:
    @El_Heffe said:
    So Linux, or some variations of Linux, may not have a "rename" command that's actually built into the operating system, something that DOS 1.0 had 30 years ago.  That's the most retarded thing I've ever heard.

    Sure it does; it's just not called "rename." It's called "mv", because it can not only move a file from one name to another in the same location; it can move a file to another location, even across file system boundaries, with the same or changed name.

    Yeah, but you absolutely have to agree that it's embarrassing that the guys who created mv didn't have enough smarts to predict what DOS 1.0 would do ten years later.

    FWIW, on Windows 8, move acts like mv in that it can rename a file in place. I don't know how long that feature has been there.

    since MS-DOS, as any filesystem (or at least FAT for sure, and NTFS too, AFAIK) considers a "file name" to be a "fully qualified name", which is basically its full path, which means that renaming and moving is naturally the same operation if happening within one partition, e.g. no actual data is required to be physically moved/copied.



  • @Medinoc said:

    RE move vs rename: If I get it right, the two POVs are:

    • Various people: "name is part of the file path, so move and rename are really the same".
    • Blakey and El_Heffe: "Moving and renaming are two different things, and even if it's the same under the hood it means to have the same command for both is leaky abstraction."

     

    I suspect the POVs are derived from OS perception of the operation - they're both a change, it's just what is being changed.

    (edit: flab beat me to it)

    @blakeyrat said:

    Why doesn't Apache just ask the OS for notifications on those files, and only re-read the config if they change? Like IIS does? I mean... derp?

    We did this one before - *nix administrators usually prefer that they control when changes to files get picked up, in the same way that any changes to code don't immediately get auto-committed back to some CVS.

    @Medinoc said:

    Does *n*x even have file change notifications?

    Yes.  Many monitoring systems make use of them.

     


Log in to reply