I tried renaming a file in Ubuntu



  • @Cassidy said:

    @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!

    Since neither /usr/bin/mv nor /usr/bin/rename are actually bash builtins, and since the main purpose of bash is convenient launching of other things, recompiling bash to get a rename feature is probably not the natural way to get it done.

    If you were really determined to have a rename command available to you on a POSIX-like system that worked the same way as the one built into the Windows cmd shell, you could write that as a stand-alone executable and stick it in any directory listed before /usr/bin in your PATH environment variable (traditionally ~/bin if you just want it for yourself, or /usr/local/bin if you want to impose it on all users of that computer.) You could also symlink it as "ren" if that's the DOS form you're used to using.

    Your main difficulty would be dealing with the fact that POSIX shells attempt to expand wildcards in command line filenames before invoking the command, while the semantics of DOS/Windows "rename" make wildcards do double duty as file selectors and replacement pattern placeholders. For example, if you had a directory containing foo1.jpeg, foo2.jpeg, foo3.jpeg, foo4.jpeg and foo5.jpg, DOS rename semantics should let you use ren *.jpeg *.jpg and end up with foo1.jpg, foo2.jpg, foo3.jpg, foo4.jpg and foo5.jpg. On a POSIX shell, your rename binary would typically not see wildcard parameters at all - typing ren *.jpeg *.jpg into a normally-configured POSIX shell would invoke ren with arguments foo1.jpeg, foo2.jpeg, foo3.jpeg, foo4.jpeg and foo5.jpg.

    You could write your rename command to undo the filename expansion and work out where the original wildcard probably was, but this would almost certainly go wrong for somebody sometimes. Or you could do what the POSIX "find" command does with wildcard-containing arguments to its -name option, and require that the user remember to surround them with quotes so as to suppress filename expansion by the shell. Or you could encourage your users to remember to turn off filename expansion altogether (most shells have an option for that). None of these are much good, which is why both the POSIX-compatible rename commands referenced above have chosen conceptual separation of renaming rules and file selection. The downside of this decision is that the commands are less concise, and less like what DOS people are used to (an Ubuntu equvalent of the command above would be rename s/eg$/g/ *.jpeg). The upside is that you can do more things to the names of your selected files than are possible with DOS semantics.

    Personally, I see parallels between people who refuse to come to grips with local CLI differences like this, and people who write things like

    #define BEGIN {
    #define END }
    as the first two lines of any of their C source code. Both, it seems to me, display a regrettable lack of mental flexibility.


  • ♿ (Parody)

    @blakeyrat said:

    @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".

    The path of the file is kind of like it's address. When the name changes, it's moved to a different place in the file system. Why you'd think it's crazy to not require two different commands for different types of moving says more about you than the commands.



  • @SEMI-HYBRID code said:

    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.

    Fun fact: the MS-DOS "ren" command would not let you move a file across directories within the same volume, even if the underlying system call (AH=56h, available since DOS 2.0) allows it. Just like the Unix rename() call.

    I never understood why "move" had to be an external program when "ren" and "copy" were built-in.



  • How did this turn into a debate on UNIX and PHP's WFTs? What about BlakeyRat's WFTness?

    He really thinks he's such a demi god that he can simply move to another O/S and guess the commands?

    Hey, Blakey - if someone (dog forbid) plonked you in front of a mainframe terminal would you just start typing random shit assuming that, at some point, you'd luck on the correct phrase? Or would you check the manual or, heaven-forfend, google it?

    UNIX (and Linux) have managed without you perfectly well for the last forty years...



  • @aapis said:

    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.
     

    It's not stupid.  Rename is a misnomer when working with a file system.  There is no such thing as renaming a file and there never has been one.  It has always been a matter of moving a file.  Back in the DOS days, the "ren" command was the exact same thing as the "move" command. Both commands still exist in the Windows command prompt today.  In the C language, there is no "rename", there is only a "move". That's because, at the OS level, there is no interrupt for "rename", only "move".

    So "move" was there before "rename" and using "rename" to move files is stupid.  :)



  • @blakeyrat said:

    ubuntu@ip-xx-xxx-xx-xxx:/var/www$ rename index.php info.php
    Not enough arguments for index at (eval 1) line 1, near "index."
    Bareword "php" not allowed while "strict subs" in use at (eval 1) line 1.

    What the FUCK does that MEAN!?!?! I understand every word up to "arguments", beyond that point it's gibberish.

    Which brings up two questions:

    1) What's the command for renaming a file?

    Apparently there isn't one, but you can change the file name using the "mv" (presumably "move?") command.

    2) What in holy shit does "rename" do if not rename files?

    Fuck if I know.

     

    I have 3 suggestions. 

    1. $ man rename
    2. $ man mv
    3. http://www.walmart.com/ip/2413769?wmlspartner=wlpa&adid=22222222227001125380&wl0=&wl1=g&wl2=c&wl3=14108660710&wl4=&wl5=pla&wl6=35026599910&veh=sem

     

     



  • I was hoping point 3 led to a recruitment page, but I was sadly disappointed.

    I have to say, I'm on BlakeyRat's side here. Linux commands are arcane and not guessable; the reason they remain so is amply demonstrated by the "Linux has been fine without you for 40 years" crowd here who are clearly resistant to change, even when that change would be a net benefit to everyone.


    This is why the only flavour of Unix that is widely used for desktop machines is OSX. Apple abstracted the arcane stuff and made it so anyone, even my mother, could use the OS.


    Linux/Unix users seem to exude an arrogance that suggests, "if you cant work it out by RTFM, fuck off," which is hardly helping their cause.



  • @scudsucker said:

    I was hoping point 3 led to a recruitment page, but I was sadly disappointed.

    I have to say, I'm on BlakeyRat's side here. Linux commands are arcane and not guessable; the reason they remain so is amply demonstrated by the "Linux has been fine without you for 40 years" crowd here who are clearly resistant to change, even when that change would be a net benefit to everyone.


    This is why the only flavour of Unix that is widely used for desktop machines is OSX. Apple abstracted the arcane stuff and made it so anyone, even my mother, could use the OS.


    Linux/Unix users seem to exude an arrogance that suggests, "if you cant work it out by RTFM, fuck off," which is hardly helping their cause.


    Then let's hear the justification for adding a rename command. Go on, demonstrate to me how the OS becomes better by adding one command for one edge case use, when anyone even SOMEWHAT educated in linux knows what mv is, and how to use it without any difficulty.


    Hell, I knew that before I studied it in school.



  •  @scudsucker said:

    This is why the only flavour of Unix that is widely used for desktop machines is OSX.

    Probably. However, Blakey's not using a desktop Linux distro, he's attempting to manage a Linux server, so... wrong set of goalposts.

    @scudsucker said:

    Linux/Unix users seem to exude an arrogance that suggests, "if you cant work it out by RTFM, fuck off,"

    You'll be surprised at the number of people that sit at a complex bit of kit and expect it to be usable without reading any instructions first.

    @scudsucker said:

    which is hardly helping their cause
     

    That presupposes the *nix crowd have a cause. Most I've met are content to crack on with learning the capabilities of the systems they're managing and accept that it is what it is: it's in place, it ain't gonna change soon and it needs attention to keep it operational. Shape the knowledge and skillset of the individual to fit the problem.



  • @scudsucker said:


    I have to say, I'm on BlakeyRat's side here. Linux commands are arcane and not guessable; the reason they remain so is amply demonstrated by the "Linux has been fine without you for 40 years" crowd here who are clearly resistant to change, even when that change would be a net benefit to everyone.



    Not really. As you can see from the myriad posts above this one, there is a very good reason why the "rename file" command is "mv." Personally, I haven't used linux since college, and I don't remember the commands that well, but when someone says "hey, the rename file command is the same as the move command because all move does is change a file address," that makes instant sense, because I actually understand what a filesystem is.

    @scudsucker said:

    This is why the only flavour of Unix that is widely used for desktop machines is OSX. Apple abstracted the arcane stuff and made it so anyone, even my mother, could use the OS.


    That's not actually a laudable goal when it comes to software development tools though. Why the fuck would it be a good thing to make it so that anyone, even idiots who have no experience, training or talent, can bang together some keys and eventually end up with something resembling working software? Yes, you might have to actually take the time to LEARN the tools in order to use them. This is not a bad thing. What would be bad is if the tools aren't useful or don't do what you need them to do. But that's not what Blakey is complaining about. He's complaining that he can't be bothered to read a simple command list or check a help file. That's not how a good software developer thinks.

    @scudsucker said:
    Linux/Unix users seem to exude an arrogance that suggests, "if you cant work it out by RTFM, fuck off," which is hardly helping their cause.


    Yes, because RTFM is kinda important to software development. If you don't actually read the manual, you can't actually know what is going on, and simply assuming things will work a certain way will bite you in the ass.



  • @Cassidy said:

    You'll be surprised at the number of people that sit at a complex bit of kit and expect it to be usable without reading any instructions first.

    I wouldn't.



  • @Cassidy said:

    2-character commands were more memory-efficient

    Easier to type.



  • Goddamned people. I can't read and respond to like 2 fucking pages of pile-on.



  • @scudsucker said:

    Linux commands are arcane and not guessable;

    Consider any non-english speaking user who has to use the command line. "Copy" is not a word in a language other than English; so to do even the most basic things on a computer requires the user to look up the correct command in a manual. This is no different than a english-speaking user attempting to use the command line in Windows or Linux. The first couple of times the user has to look up the command; eventually the user learns what it is.


    No command line system is so obvious that you can just start typing and get the computer to do what you want.


    Eventually, the english-speaking user (as well as the non-english speaking user) will say "on windows, I have to type rename; on linux I have to type mv". "Oh -- and to change the location of a file, on linux I can use mv too".


  • sekret PM club

    @Snooder said:

    @scudsucker said:


    I have to say, I'm on BlakeyRat's side here. Linux commands are arcane and not guessable; the reason they remain so is amply demonstrated by the "Linux has been fine without you for 40 years" crowd here who are clearly resistant to change, even when that change would be a net benefit to everyone.


    Not really. As you can see from the myriad posts above this one, there is a very good reason why the "rename file" command is "mv." Personally, I haven't used linux since college, and I don't remember the commands that well, but when someone says "hey, the rename file command is the same as the move command because all move does is change a file address," that makes instant sense, because I actually understand what a filesystem is.

    @scudsucker said:

    This is why the only flavour of Unix that is widely used for desktop machines is OSX. Apple abstracted the arcane stuff and made it so anyone, even my mother, could use the OS.


    That's not actually a laudable goal when it comes to software development tools though. Why the fuck would it be a good thing to make it so that anyone, even idiots who have no experience, training or talent, can bang together some keys and eventually end up with something resembling working software? Yes, you might have to actually take the time to LEARN the tools in order to use them. This is not a bad thing. What would be bad is if the tools aren't useful or don't do what you need them to do. But that's not what Blakey is complaining about. He's complaining that he can't be bothered to read a simple command list or check a help file. That's not how a good software developer thinks.

    @scudsucker said:
    Linux/Unix users seem to exude an arrogance that suggests, "if you cant work it out by RTFM, fuck off," which is hardly helping their cause.


    Yes, because RTFM is kinda important to software development. If you don't actually read the manual, you can't actually know what is going on, and simply assuming things will work a certain way will bite you in the ass.

    Uh...how is "basic usage of an operating system" equivalent to software development? Linux isn't a "software development tool", it's an operating system (yes, yes, kernels and distributions, I know). An operating system shouldn't need manuals equivalent to a CCNA course text in order to figure out basic usage, like moving/renaming files. I know that half the time I need to futz with my Ubuntu media center box, I end up having to look up exactly how the commands need to be phrased (usually because there's either no GUI equivalent to what I'm doing, or if there is, it's buried 45 pages deep in a forum thread underneath all the CLI stuff.)

    I can understand having to read a manual to learn things like programming languages, development tools, and the like. An OS should be inherently discoverable, at least in a useful world.


  • Trolleybus Mechanic

    @blakeyrat said:

    Goddamned people. I can't read and respond to like 2 fucking pages of pile-on.
     

    Summary: Use "mv". Your expectation of "rename" is an assumption.

    The rest: the usual Linux/Unix usability arguments.

    My thoughts: this is Karma bashing you like you deserve for driving CueCat out of business.


  • Considered Harmful

    @Lorne Kates said:

    Your expectation of "rename" is an assumption.

    But blakeyrat doesn't assume!

    How about we symlink all the common wrong commands to some kind of Linux CLI tutorial app.



  • @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.

    That's because they defined the system specifically to exclude the average Joe, so they could remain the "high priest of technology" and draw a larger salary. Their motives behind it are detestable, and nobody should be defending them.

    @gilhad said:

    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.

    I just want the Linux community to give a shit about the quality of their software.

    @FrostCat said:

    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.

    So it's a WTF in Windows, too. Are you trying to paint me as some kind of hypocrite or something?

    The reason I'm not writing this rant about Windows is that it's 40,000 times easier to set up a web server in Windows, and you never need to drop to the fucking CLI to do it.

    @anonymous234 said:

    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.

    Which means all these people are being brainwashed by this shitty operating system. It's goddamned criminal.

    @Helix said:

    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.

    It's because it has Super Cow Power!!

    Or, more seriously, because a lot of people never bother doing a cost/benefit analysis of software that considers total cost over a few years, and correctly accounts for the number of hours wasted by broken bullshit in Linux. So if some idiot 18-year-old "rock star" swoops down and says Linux is better, giving absolutely ZERO evidence to prove his case, the idiot managers will trust him.

    @Helix said:

    I think Linux has held back human civilisation development .. engineers and scientists fixing stupid bugs instead of computing new problems.

    Mostly it just holds back itself, via the CADT development model, which guarantees Linux software will never fully mature.

    @ubersoldat said:

    Man, I'm sooooo tired of reading stupid ass rants like this

    Well fortunately my account has a very distinctive icon and is easy to avoid. Get the fuck out.

    @ubersoldat said:

    You're complaining about a set of tools that have been around for more than 30 years,

    McDonalds has been around for more than 30 years. It still sucks.

    @ubersoldat said:

    that you don't even comprehend how they work and that your so self-impossed genius is above reading a single man page.

    Based on only the CLI itself, how would I know that "man" pages even exist?

    @ubersoldat said:

    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),

    Yeah, right-- I forgot that Linux Rule(tm): if you're talking about something positive, it's "Linux", if you're talking about something negative, it's one particular distribution and no other distributions have the same problem. How can we mislead people into thinking Linux isn't shit if we don't follow the Linux Rule(tm)!?

    @PJH said:

    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.

    I agree.

    @PJH said:

    A Windows[tm] GUI[r] fanboi who refuses to learn CLI tools out of some misguided principle,

    "Misguided principle?" Seriously? You've been on this forum long enough, you know EXACTLY what my problem with CLI tools is. Hint: it's not a "principle", it's an actual physical disability which makes them extraordinarily difficult for me to use.

    @PJH said:

    or gets confuzzled at the word 'stanza' in documentation,

    Why wouldn't that confuse me? It's not a common term, and it's not defined.

    @esoterik said:

    They are in Linux and Unix; this sorta makes sense if you think of the entire path as the 'name'.

    But it's obviously not.

    Exercise 1

    Question: I have a file: ~/folder1/folder2/file.txt. I rename "folder1" to "poop". Has the name of file.txt changed?

    Answer: (Everybody on Earth): Of course not, that's a fucking stupid question!
    Answer: (One Linux user in the back): Yes!

    @esoterik said:

    The man page for mv has some language to the effect that moving a file is the same operation as renaming.

    Yeah well I can write "some language" that Hitler was a saint who cured cancer, that doesn't make it fucking true.

    @PJH said:

    @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.

    Come up with a workable definition of "system administrator" that excludes me. I dare you. I double-dog dare you.

    @Cassidy said:

    @blakeyrat said:
    The filename isn't part of the file.
    I'd have thought file metadata was part of the overall file contents.

    Where the OS stores the meta-data (whether "inside" the file itself or in the filesystem) is an irrelevant implementation detail. Conceptually, the filename is not part of the file. Neither is its size, modification date, etc.

    I think a big problem of Linux users is that they know *too much* about how the computer does things behind the scenes and thus are literally incapable of making distinctions like the above.

    @Medinoc said:

    Does nx even have file change notifications?

    Ok; I think Linux is a ball of shit and even I don't think it's THAT shitty. How could it possibly not? Isn't the main image of Linux you see bearded geeks with 18 terminals on their desktops filled with scrolling log files? How could you make the stereotyped Linux user image without filesystem notifications?

    @esoterik said:

    likes to feign ignorance and be intentionally obtuse or

    Sometimes I do that to make a point; usually to imagine (or help others to imagine) how a naive user would react to the system.

    @esoterik said:

    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.

    You read my posts here, do you honestly think I'm retarded?

    BTW: here's the Linux community in a nutshell. Even the IT community. This is why we never progress anywhere. "You think differently than me? You have different priorities, opinions? Well you're a retard."

    No. Not acceptable.

    @flabdablet said:

    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.

    You realize of course that if "rename" just did what its name implies it did, this whole post wouldn't exist? I'm not asking for "mv" to stop existing or change behavior, I'm just asking for the command named "rename" to rename a file. (The other one could be called "regex-rename" or some shit; it sounds like nobody uses it anyway.)

    @flabdablet said:

    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.

    Yes it is, but it's still worth saying. Maybe the next time someone designs a CLI, they won't make the same mistakes.

    @flabdablet said:

    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.

    You're talking about the status quo as if it's an immutable law of nature. It's unrealistic, for current CLIs. But: 1) it shouldn't be. 2) there's no law of nature that says a CLI necessarily must be difficult to use.

    This CLI (and others, like CMD) are difficult to use because the people who created them didn't give a fuck. As soon as Microsoft started giving a fuck, the deprecated the thing and invented the much easier VBScript and JScript to replace it. As soon as Linux started giving a fuck they-- oh wait Linux never did start giving a fuck, that is the problem in a nutshell isn't it?

    Like I said above, all I want is for the Linux community to start giving a fuck about the quality of their software.

    @flabdablet said:

    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.

    Explain why.

    @flabdablet said:

    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.

    Haha, what's the fucking reward? "You can do some, but not even close to half, of the stuff you do now in the GUI and it takes longer and is more annoying." Some reward!

    @flabdablet said:

    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.

    Utter bullshit.

    So the reason an artist uses Photoshop is because they can use it, and I quote, "without thinking too hard"? It's not because the GUI is inherently superior for a extremely large number of tasks? It's just because everybody who doesn't use the CLI is fucking stupid?

    Fuck you, man. Fuck off.

    @SEMI-HYBRID code said:

    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.

    Exercise 2

    Question: I have a file at the path ~/folder1/folder2/file.txt. I run the following command: mv ~/folder1/folder2/file.txt ~/poop/folder2/file.txt. What happens?

    (Seriously, I haven't tried it. I assume Linux creates a new folder called "poop", and a new "folder2" inside it. Which would mean: a single move command can result in THREE operations taking place, TWO of which are making new directories.

    Or it returns an error, saying the folder ~/poop/folder2 doesn't exist, meaning practically everybody posting in this thread is wrong about filenames.)

    @Cassidy said:

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

    Who gives a shit? Computers are for users.

    @Cassidy said:

    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.

    If we did this before, maybe use this clever invention called a "link"?

    But... fucking WHY!?!?!? Why would anybody want that?

    Blah blah blah I'm done.



  • And let me just add, I'm super disappointed that none of you are out there challenging this bullshit:

    @flabdablet said:

    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.

    How did nobody call-out flabdablet on this before me? You all suck.



  • @skotl said:

    UNIX (and Linux) have managed without you perfectly well for the last forty years...

    That's why Linux is so popular and beloved? Oh wait. Nobody uses it, except people on Android cellphones who only use it because they don't know it's Linux. And even die-hard life-long Unix lovers are on MacBook Air's.

    Demonstrably something is wrong.



  • @Snooder said:

    Not really. As you can see from the myriad posts above this one, there is a very good reason why the "rename file" command is "mv."

    I've seen a lot of shitty reasons. I haven't seen a "very good" reason yet.

    @Snooder said:

    Personally, I haven't used linux since college, and I don't remember the commands that well, but when someone says "hey, the rename file command is the same as the move command because all move does is change a file address," that makes instant sense, because I actually understand what a filesystem is.

    1. That quote is demonstrably false, as I demonstrated in the mega-post.

    2) Users shouldn't have to understand what a filesystem is to use a computer.

    @Snooder said:

    Why the fuck would it be a good thing to make it so that anyone, even idiots who have no experience, training or talent, can bang together some keys and eventually end up with something resembling working software?

    Why would you assume that someone who is an expert in the CLI will make a decent piece of software? My experience tells me they usually write shit software that is shit.

    I wrote software for Mac Classic; Mac Classic didn't even have a CLI. Does that mean, by your logic, that all Mac Classic software, literally every single program on the OS, was "something resembling working software?" Is that seriously what you're suggesting?

    I can't debate with people this delusional. (And insulting.)

    There's is no correlation between "people who know the CLI well" and "people who are good at writing software". (And, for that matter, "idiots who have no experience, training or talent". Not until you fucking demonstrate one with evidence.

    @Snooder said:

    Yes, you might have to actually take the time to LEARN the tools in order to use them. This is not a bad thing.

    Yes it is. People who learn Git might actually think Git is a good piece of software, and use it as a model for their own program-- now the world has even more shitty software.

    @Snooder said:

    That's not how a good software developer thinks.

    Ok, I'm not sure what thread you're posting on, but you seem pretty fucking confused:

    1) I wasn't developing software; I was installing a web server.

    2) Whenever I've posted about software development here, I've constantly emphasized the importance of coding to the documentation, not to the system implementation-- which is exactly what you seem to be assuming I don't do. You can go back and check my posts; I'll wait.

    @Snooder said:

    Yes, because RTFM is kinda important to software development.

    I wasn't developing software, I was installing a web server.

    Are you making some kind of tacit assumption that the only purpose of a CLI is software development here? What's going on Snooder? You're confusing the fuck out of me.

    Edit: Looks like e4tmyl33t was similarly confused. Come back here and explain where your mind's at, Snooder!


  • ♿ (Parody)

    @blakeyrat said:

    You realize of course that if "rename" just did what its name implies it did, this whole post wouldn't exist?

    But that's exactly what it does! It changes the filename part of a file's metadata to something else!


  • Trolleybus Mechanic

    @joe.edwards said:

    @Lorne Kates said:
    Your expectation of "rename" is an assumption.

    But blakeyrat doesn't assume!

     

    ... that was the point of the summary.  This whole discussion could have gone like this:

    Blakey (in previous threads): Don't assume, learn the tool instead.

    Blakey: This command doesn't work as expected!

    Linux person: That's not expected. That's an assumption. Use mv instead.

    Blakey: Oh, oops. Thanks for the right command. I've learned something, and none of you wasted countless manhours pointlessly bickering about Linux usability. We can all go about our days in a happy and productive manner.

    END OF THREAD

     



  • @powerlord said:

    @blakeyrat said:

    @powerlord said:
    and they usually require it
    Who is "they"?
     

    I thought Universities was implicit there.  I guess I forgot who I was talking to.

    Yeah. Uh no.  Your sentence structure was such that the implied "they" was CS Degrees.
    I agree with blakey though.


    A command's name should be indicative of its function and such function should be readily apparent to the user from the command name (based on the minimum level of user knoweldge of the OS for a user with a legitimate use for the command).
    Renaming a file is a very common function, and even the most inexperienced user would have a legitimate need to rename a file.  Thus MV is not an appropriate name for a "RENAME" command.

    MV does not in any way indicate "rename" unless one has a closer to bare metal understanding of the file system; and even then might not be indicative depending on how the operating system actually handles file names.

    I can understand why MV was created as a two in one move and rename; the original developers developed a move command for relocating files/objects within the directory structure, later someone wanted to be able to just rename a file (which the developers never even imagined someone would want to do) and just said "meh - just use mv".  Then someone wanted a more powerful rename command for batch renames with wildcards and created the perl script referenced and named it RENAME, thus creating confusion for anyone moving from an OS with an explicit rename command.

     This is my biggest gripe with Linux; the vast majority of Linux users and developers refuse to make the operating system and commands accessible to casual users and prefer to obfuscate the simplest actions; and instead of simply admitting "Yeah, that command isn't really named appropriately" or "You're right, the command line switches for that command are much more complicated than necessary" they respond with "You should have run the MAN page for that."   So, Blakey should have pulled up the MAN page for RENAME?  Would that have told him "no, you dont want to use RENAME you want to use MV"?  No, it wouldn't have.



  • @DrPepper said:

    Consider any non-english speaking user who has to use the command line. "Copy" is not a word in a language other than English; so to do even the most basic things on a computer requires the user to look up the correct command in a manual. This is no different than a english-speaking user attempting to use the command line in Windows or Linux. The first couple of times the user has to look up the command; eventually the user learns what it is.

    Well, ok. But the lesson I take from that is maybe the CLI should have localized commands. Memorizing arbitrary bullshit seems to be the wrong answer, especially since most human beings are very bad at memorizing arbitrary bullshit.

    @DrPepper said:

    No command line system is so obvious that you can just start typing and get the computer to do what you want.

    Maybe none that exist now. But there's no immutable law of nature that says that must be the case. There wasn't any heavier-than-air flying machine until some guys fucking built one.



  • @ubersoldat said:

    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.

    +1


  • :belt_onion:

    @blakeyrat said:

    ubuntu@ip-xx-xxx-xx-xxx:/var/www$ rename index.php info.php
    Not enough arguments for index at (eval 1) line 1, near "index."
    Bareword "php" not allowed while "strict subs" in use at (eval 1) line 1.

    Why has no one discussed how terrible of an error message this is? If the error message was something like "argument 1 is not a regular expression", "Usage: rename <regular expression> <files>", or even "argument 1 is not a regular expression (did you mean to use mv?)" we might not even be having this discussion (as valuable a discussion as it is).

    Fucking Perl.

     



  • @blakeyrat said:

    @skotl said:
    UNIX (and Linux) have managed without you perfectly well for the last forty years...

    That's why Linux is so popular and beloved? Oh wait. Nobody uses it, except people on Android cellphones who only use it because they don't know it's Linux. And even die-hard life-long Unix lovers are on MacBook Air's.

    Demonstrably something is wrong.

    You do realize that OS X is a Unix, and a damned good one at that. It's easily the best mix of usability while still maintaining the power of a good command line, so your point is a bit retarded. Die-hard life-long Unix lovers are le gasp USING UNIX!

    It's fucking mindblowing, I know. How dare those Unix lovers choose a computer that runs Unix.


  • Considered Harmful

    To walk a thorny road, we may cover its every inch with leather or we can make sandals.

    There are two basic philosophies at play here: some feel you should adapt your environment to suit you, and others feel that you should adapt to your environment. You can do either with Linux (for the former approach, I offered you a one-line solution to your problem almost immediately), though the prevailing philosophy of Linux is the latter - that you should adapt yourself to the way things work. This has the advantage of working even when you're outside of your nicely terraformed environment.


    In this thread we've already seen that there's no agreement on what a CLI should be. I'm inclined to think, as some others before me, that it's a language that must be learned. No problem, I'm a programmer, learning new languages is kind of my thing. The worst sin in learning a new language is thinking you already know how it works (see: Javascript). The command could have been Xyzzyx and I'd learn to type that; but because rename is a cognate, we naturally make some (invalid) assumptions about what it does.

    Maybe Xyzzyx reformats your hard drive, that wouldn't be too surprising because it doesn't set any expectation. Maybe rename does the same thing, that would end up on this website for sure, but it would still be PEBKAC because the user is typing commands that he doesn't know and expecting them to work. I might think I can speak Spanish by speaking English but prefixing everything with "el" and postfixing it with "-o", and maybe I can make out a lot of what's being said by recognizing cognates; but really I'd just be making a fool of myself (and I'd be wrong about some of the cognates).

    The other main viewpoint is that the CLI should "just work" and to the best of its ability, use advanced algorithms and black magic to divine and interpret the user's intention and carry it out. I'm of the opinion that this is not just technically challenging, it's literally impossible to get right all of the time for all of the users. Part of this is because natural language has so much inherent ambiguity, another part is that the average untrained user isn't accustomed to being especially precise in his usage of language. I've bumped into this in my daily life: I've been told I'm being too literal when following instructions, that I should have inferred more and done what they wanted not what they asked.

    Is there a happy middle ground? Maybe. If it exists, it's still undiscovered.



  • @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>

    Let me sum up your synposis:

    "Linux isn't windows, and therefore sucks."

     It is Blakeyrate, after all.



  • @Master Chief said:

    Then let's hear the justification for adding a rename command. Go on, demonstrate to me how the OS becomes better by adding one command for one edge case use, when anyone even SOMEWHAT educated in linux knows what mv is, and how to use it without any difficulty.
     


    Blakeyrat is not the only person to have a mental model of renaming and moving being different things. The vast majority of people think of it this way (I'd guess), which means that they will try "rename" or "ren" when they are trying to rename a file, and they will fail because there is a rename command but it does not do what anyone would expect it to do. If they at least got a "command not found" they would probably try mv, but the new "rename" makes everything worse. Plus, the cost of making "rename" an alias to "mv" was virtually zero.


    The problem with the "you should read the manual" or "you should not expect this command to do this" arguments in this thread is that they can be applied to literally any system, yet it's clear that some systems are better than others. If "mv" was called "kern_changecall_batched" and required 5 extra arguments each time, you would still be defending it and linking it to the "rename" man page which clearly explains that it's a tool for formatting your disk without confirmation.

    (Plus, nobody ever learns a system by reading the manual, it's tedious and inefficient. YOU didn't learn the full bash syntax before trying the first command, and in any case the man page is useless for locating a different command.)



  • @joe.edwards said:

    There are two basic philosophies at play here: some feel you should adapt your environment to suit you, and others feel that you should adapt to your environment.

    Both of those are wrong, when it comes to a discussion of computer UIs.

    The fact is, we have a LOT of data on how human beings work, mentally. We know what people's minds can do easily, and what is difficult for them. The system should be designed to correspond to what we know of human capabilities. That was the beauty of Apple's work in the mid-80s; they weren't just flailing around, they created what they created as a result of actual science. Spacial navigation didn't exist because someone thought it looked neat, it existed because of psychological studies that proved that it was the superior approach.

    Or, in short, the philosophy should be: adapt the environment to suit virtually everybody with normal cognitive function.

    @joe.edwards said:

    In this thread we've already seen that there's no agreement on what a CLI should be.

    Most of the people are offering the (useless) position: "it should never change, change is evil".

    @joe.edwards said:

    Maybe rename does the same thing, that would end up on this website for sure, but it would still be PEBKAC because the user is typing commands that he doesn't know and expecting them to work.

    Let me get this clear: typing "rename" and having an erased hard-drive would be the user's fault!?

    @joe.edwards said:

    The other main viewpoint is that the CLI should "just work" and to the best of its ability, use advanced algorithms and black magic to divine and interpret the user's intention and carry it out. I'm of the opinion that this is not just technically challenging, it's literally impossible to get right all of the time for all of the users.

    It's hard to say how challenging it is, since nobody's fucking tried it.

    But I'd have to first be convinced that there's a point to doing it at all; a much better approach would be to just take the (extremely few) things a CLI does better than a GUI, and implement those in the GUI.

    Still it would be nice if someone fucking tried.



  • @Medezark said:

      So, Blakey should have pulled up the MAN page for RENAME?  Would that have told him "no, you dont want to use RENAME you want to use MV"?  No, it wouldn't have.

     man rename

    .....

    SEE ALSO
           mmv(1), mv(1)

     



  • @ubersoldat said:

    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.

     

    You're an asshole and an idiot.


  • sekret PM club

    @joe.edwards said:

    The other main viewpoint is that the CLI should "just work" and to the best of its ability, use advanced algorithms and black magic to divine and interpret the user's intention and carry it out. I'm of the opinion that this is not just technically challenging, it's literally impossible to get right all of the time for all of the users. Part of this is because natural language has so much inherent ambiguity, another part is that the average untrained user isn't accustomed to being especially precise in his usage of language. I've bumped into this in my daily life: I've been told I'm being too literal when following instructions, that I should have inferred more and done what they wanted not what they asked.

    I wish we had an interface that understood language that easily. We'd just need to add learning bits and speech recog/synthesis and we'd have a proper AI.



  • @heterodox said:

    @blakeyrat said:

    ubuntu@ip-xx-xxx-xx-xxx:/var/www$ rename index.php info.php
    Not enough arguments for index at (eval 1) line 1, near "index."
    Bareword "php" not allowed while "strict subs" in use at (eval 1) line 1.

    Why has no one discussed how terrible of an error message this is? If the error message was something like "argument 1 is not a regular expression", "Usage: rename <regular expression> <files>", or even "argument 1 is not a regular expression (did you mean to use mv?)" we might not even be having this discussion (as valuable a discussion as it is).

     

    Argument 1 IS regular expression. And very simple one. Do you think that  "your regular expression is too easy for me" is good message in this case?  The regular expression index.php mathes index1php index2php index3php ..... and also index.php ofcourse.

     

    The problem is, that rename expects 3 arguments and only 2 was provided, so " Not enough arguments" says it all. If you are curious, why 2 arguments are not enought, use "man rename", I bet, that there is explanation for it :)

     


  • Considered Harmful

    @blakeyrat said:

    @joe.edwards said:
    Maybe rename does the same thing, that would end up on this website for sure, but it would still be PEBKAC because the user is typing commands that he doesn't know and expecting them to work.

    Let me get this clear: typing "rename" and having an erased hard-drive would be the user's fault!?

    OK, I used an extreme example, because in general I feel like typing random words into a console screen is playing with fire. Suppose then rename applied a rename operation, but to a partition or mountpoint or something, such that using it incorrectly could cause Very Bad Things to happen. I'm reminded of The Sorcerer's Apprentice where experimenting with too much power can be dangerous - though this perhaps reinforces your High Priesthood theory.

    @blakeyrat said:

    It's hard to say how challenging it is, since nobody's fucking tried it.

    ...

    Still it would be nice if someone fucking tried.

    Maybe somewhere at a well-funded usability research lab, but I certainly wouldn't waste my time and/or money on an experiment whose premise I believed to be intrinsically flawed and doomed to failure.



  • @joe.edwards said:

    OK, I used an extreme example, because in general I feel like typing random words into a console screen is playing with fire. Suppose then rename applied a rename operation, but to a partition or mountpoint or something, such that using it incorrectly could cause Very Bad Things to happen. I'm reminded of The Sorcerer's Apprentice where experimenting with too much power can be dangerous - though this perhaps reinforces your High Priesthood theory.

    The CORRECT solution to this problem (one the GUI already has implemented virtually everywhere, BTW) is to offer an "undo" command/whatever that allows the user to rewind to before the mistake was made.

    Even fucking SQL has one. Why the fuck doesn't the CLI? (Let me guess: because it would be non-trivial to implement. Aw. Poor baby.)



  • @blakeyrat said:

    Let me get this clear: typing "rename" and having an erased hard-drive would be the user's fault!?
     

    Let me get this clear: On Windows I want to format all documents on drive D: to look pretty and professional, so I open the command prompt and type:

    FORMAT D: 

     

    There is some question, but I do not understand it and I do not want to read it, so I just type Yes and hit Enter (It usually works with dialogs).

    It is my fault, or system fault, that I have no nice formated documentsnow?

     



  • @gilhad said:

    It is my fault, or system fault, that I have no nice formated documentsnow?

    Both. It's your fault that you didn't read the warning. It's the system's fault that it spits out warnings so often for trivial matters that they aren't taken seriously. It's the system's fault that it doesn't have a way of undoing the operation.

    If you think I've ever said, "WHOA GUYS CMD IS FUCKING GREAT AWESOME SO BEST SOFTWARE SQUEEE" then you're mistaken; it sucks shit too. The reason it doesn't matter as much that it sucks shit is, 1) it's been deprecated for literally decades at this point, and 2) you never need to actually USE the thing to do some general task (like installing a web server).


  • ♿ (Parody)

    @joe.edwards said:

    @blakeyrat said:
    ...

    ...but I certainly wouldn't waste my time and/or money on an experiment whose premise I believed to be intrinsically flawed and doomed to failure.

    And yet you reply to blakeyrat.



  • @blakeyrat said:

    @gilhad said:
    It is my fault, or system fault, that I have no nice formated documentsnow?

    Both. It's your fault that you didn't read the warning. It's the system's fault that it spits out warnings so often for trivial matters that they aren't taken seriously. It's the system's fault that it doesn't have a way of undoing the operation.

    If you think I've ever said, "WHOA GUYS CMD IS FUCKING GREAT AWESOME SO BEST SOFTWARE SQUEEE" then you're mistaken; it sucks shit too. The reason it doesn't matter as much that it sucks shit is, 1) it's been deprecated for literally decades at this point, and 2) you never need to actually USE the thing to do some general task (like installing a web server).

     

    Why now it is not system fault, that FORMAT does not FORMAT documents, while on Linux it is system fault, that RENAME does RENAME files?

     



  • @heterodox said:

    Why has no one discussed how terrible of an error message this is? If the error message was something like "argument 1 is not a regular expression", "Usage: rename <regular expression> <files>", or even "argument 1 is not a regular expression (did you mean to use mv?)" we might not even be having this discussion (as valuable a discussion as it is).

    Because 0) all the CLI utilities assume that if you launch them with any arguments other than "--help", you already know what you're doing, learned instead of guessing how it works, and need not be taught the very basics of Unix command line, 1) argument 1 need not be a regular expression - it may be any series of statements which when executed results in $_ containing the new name, and 2) if you know what this utility does and how to use it, then you must be somewhat familiar with Perl, and hence recognise this syntax error.



  • @gilhad said:

    Why now it is not system fault, that FORMAT does not FORMAT documents, while on Linux it is system fault, that RENAME does RENAME files?

    Hey next time you write a question just to set up a stupid logic trap, do me a favor and let me know early so I can save time and just call you a fuckwit right away. Fuckwit.



  • @blakeyrat said:

    You realize of course that if "rename" just did what its name implies it did, this whole post wouldn't exist?
    But it does what it's name implies, it simply doesn't do it the same way rename on Windows does it (because guess what - Linux isn't Windows). I'm not sure why Debian (and Ubuntu, which is it's derivate) default to perl-rename unlike other distributions (which use rename from util-linux, that shows a brief help text instead of just erroring out when there's just 2 arguments), but that's the way it is. Look at what happens if I try the Linux syntax on Windows:
    W:\Users\ender>rename foo bar *.txt
    The syntax of the command is incorrect.

    @lizardfoot said:
    In the C language, there is no "rename", there is only a "move".
    stdio.h disagrees:
    RENAME(2)                  Linux Programmer's Manual                 RENAME(2)

    NAME
    rename - change the name or location of a file

    SYNOPSIS
    #include <stdio.h>

       int rename(const char *oldpath, const char *newpath);
    

    DESCRIPTION
    rename() renames a file, moving it between directories if required.
    Any other hard links to the file (as created using link(2)) are unaf‐
    fected. Open file descriptors for oldpath are also unaffected.

    (...)
    @Medezark said:
    I can understand why MV was created as a two in one move and rename; the original developers developed a move command for relocating files/objects within the directory structure, later someone wanted to be able to just rename a file (which the developers never even imagined someone would want to do) and just said "meh - just use mv".
    Actually, I'm pretty sure that mv supported renaming files from day one - after all, as far as the OS is concerned, renaming and moving a file (within the same filesystem) is the same operation. And since mv already supported renaming files, nobody bothered adding a separate command just for that.



  • @blakeyrat said:

    @gilhad said:
    Why now it is not system fault, that FORMAT does not FORMAT documents, while on Linux it is system fault, that RENAME does RENAME files?

    Hey next time you write a question just to set up a stupid logic trap, do me a favor and let me know early so I can save time and just call you a fuckwit right away. Fuckwit.

     So if you do not read documentation, it is Linux problem, that you do pass wrong number of params on first try.

    When I do not read documentation, I am fukwit and it is my problem, that on Windows format does not format documents.

     

    That for nice demonstration, what double-standards are.



  • @blakeyrat said:

    Hey next time you write a question just to set up a stupid logic trap, do me a favor and let me know early

    I know you like playing along with people's arguments, but when you "fall" for such basic debate tactics it ruins the illusion.


  • :belt_onion:

    @gilhad said:

    Argument 1 IS regular expression. And very simple one. Do you think that  "your regular expression is too easy for me" is good message in this case?  The regular expression index.php mathes index1php index2php index3php ..... and also index.php ofcourse.

    Whatever, I'm not familiar with the utility. I'd never even heard of it before this discussion. And your pedantic dickweedery does not undermine the point I was trying to make, which you clearly understand.

     

    @spamcourt said:

    1) argument 1 need not be a regular expression - it may be any series of statements which when executed results in $_ containing the new name, and 2) if you know what this utility does and how to use it, then you must be somewhat familiar with Perl, and hence recognise this syntax error.

    I'm familiar with Perl and I don't recognize the syntax error, or at least what my next action should be. That is, without reading the code of the utility, which is something I absolutely should not have to do. You say "all the CLI utilities assume" like it's an immutable fact of nature. It's a huge design flaw.

     



  • @locallunatic said:

    I know you like playing along with people's arguments, but when you "fall" for such basic debate tactics it ruins the illusion.

    I gave him the benefit of the doubt and assumed he was actually asking my opinion.



  • @boomzilla said:

    @joe.edwards said:
    ...but I certainly wouldn't waste my time and/or money on an experiment whose premise I believed to be intrinsically flawed and doomed to failure.

    And yet you reply to blakeyrat.

    +1 Best comment in the whole thread.


Log in to reply