The Linux command line sucks


  • area_can

    The command line (bash, zsh, fish,...) sucks for regular everyday use because:

    • one wrong keypress/character breaks everything
    • each application has its own interface (gnu vs BSD args), --foo vs -foo, dd's decision to use if and of, parameters that are literally one key away from each other on a QWERTY keyboard
    • only method of discovery is manpages/foo --help (--help is not a recognized option: use foo -h)
    • the fact that everything has to be typed led to everything being optimized for speed of entry instead of consistency and ease of use (c.f. tmpnam umount ls's manpage ls -abcdefghijABCDEFGHIJ01234)*

    Do you agree? Discuss.


    * yes I know some of those are because UNIX commands had a 7 character limit in the 80s but that's a stupid reason to be chained to those names after 38 YEARS…




  • area_pol

    @bb36e said in The Linux command line sucks:

    only method of discovery is manpages/foo --help (--help is not a recognized option: use foo -h)

    And neither of them provides actual examples of doing the thing the program was designed to do.


  • area_can

    @bb36e I also missed one more thing:

    • all the noobs and zealots that reply to these sorts of criticisms with "well maybe type better next time. The Unix Way™ is perfect, you just fucked up. Learn from your mistakes" (not directed at anyone here)

    The so called simple, perfect Unix way is 'simple' the same way Go is simple. It gives you very little and as a result you end up with people implementing generics in Go by writing their own code generators that transform Unicode characters that LOOK like <> but arent actually those characters. Look up 'golang generics Canadian Aboriginal Syllabics'.



  • My biggest gripe about Unix shells: it's way too easy to accidentally unescape, unquote and split arguments. Which leads to a fun game of guessing how many backslashes are needed when having multiple layers of scripts (my record is five).


  • area_can

    @thecpuwizard said in The Linux command line sucks:

    Keyboard RULES

    Absolutely, it sucks having to switch between typing and mousing around. I've played around with some mouse-based input prototypes and while interesting, they're just not as fast as typing (for me).

    volume slider

    But I feel like launching an application shouldn't be a freeform input. Imagine if your car's gearstick was a slider without any resistance, and it was your job to make sure you stopped it at the exact right location.



  • @bb36e said in The Linux command line sucks:

    Imagine if your car's gearstick was a slider without any resistance, and it was your job to make sure you stopped it at the exact right location.

    That's exactly how old bicycles used to work. You get used to it pretty fast.


  • area_can

    @gąska hmm, fair. But emphasis on 'old'. I can't see any benefit of the original design over contemporary ones



  • We've kind of discussed this. A lot. This thread is just one small part of that flamefest.

    0_1516549305619_krieger_also_yes.jpg



  • @bb36e said in The Linux command line sucks:

    The command line (bash, zsh, fish,...) sucks for regular everyday use because:

    I tend to think of it in a Churchillian way. It's the worst except for all the others.

    OK, that's slightly hyperbolic. It's good for some things and a GUI is good for others. The best example for me is source control. I'm pretty sure that clicking around in file trees is a Geneva Convention violation.



  • @boomzilla the Tortoises are all pretty good GUIs for their respective VCSs. Sure, when your repo gets seriously fucked, you can't fix it without CLI, but if you only use Tortoise, it rarely ever breaks.


  • area_can

    @scholrlea said in The Linux command line sucks:

    This thread is just one small part of that flamefest.

    Ooh, I'm loving all the talk about Kay and Engelbart. Bummer that the only well-known experiments on desktops these days seem to be ports of phone interfaces.


  • Discourse touched me in a no-no place

    @bb36e said in The Linux command line sucks:

    dd's decision to use if and of

    That's pretty much indefensible. The other things we could argue about, but dd is the poster child for horrible CLI.


  • area_can

    @dkf I think people who see if/of as a good idea would have also poo-pooed the invention of the firearm safety switch



  • Yes, it's true.

    I mean, you can defend CLIs, but that particular CLI is a piece of shit, because it was never designed. It just kind "happened" over time. So it's completely inconsistent.


  • Discourse touched me in a no-no place

    @scholrlea said in The Linux command line sucks:

    We've kind of discussed this. A lot. This thread is just one small part of that flamefest.

    See also https://what.thedailywtf.com/topic/12345/unix-haters-club.



  • @bb36e said in The Linux command line sucks:

    @gąska hmm, fair. But emphasis on 'old'. I can't see any benefit of the original design over contemporary ones

    Well, they always work. I've had the click-shifters get slightly out of whack - that sucks. Of course, they may have improved a bit - my bikes are 20+ years old now... Hey! They work fine!

    edit: Just realized that makes me arguing for old command lines. Oh, fuck no.



  • @bb36e said in The Linux command line sucks:

    the fact that everything has to be typed led to everything being optimized for speed of entry instead of consistency

    Try typing ls -- and then pushing tab for a list of long argument names.



  • @boomzilla said in The Linux command line sucks:

    GUI is good for others

    But most definitely NOT for automation... and I have a strong preference to automate everything possible....



  • @thecpuwizard As has been mentioned elsewhere, mostly by @blakeyrat, this is the fault of the DE designers, not of GUIs in general. He will, I am sure, quickly point out that Mac Classic had you covered, with both Applescript and HyperCard for writing automation scripts and with the macro recorder for repeating gestures.

    I, of course, would mention Smalltalk once he's done that, and he will, of course, ignore me.

    So let's take that as read, shall we?



  • @scholrlea said in The Linux command line sucks:

    both Applescript and HyperCard for writing automation scripts and with the macro recorder for repeating gestures.

    <<running and screaming>>

    For trivial stuff, that is OK, but try to do anything even moderately complicated and it quickly turns into a nightmare of unmaintainability.



  • @thecpuwizard Oh, crap. This is going to get very nasty once Word of Blakey arrives and sees what you just said.

    🍿, anyone?



  • @gąska said in The Linux command line sucks:

    My biggest gripe about Unix shells: it's way too easy to accidentally unescape, unquote and split arguments. Which leads to a fun game of guessing how many backslashes are needed when having multiple layers of scripts (my record is five).

    This is why I hate command lines - not just because of the reasons in the OP that I can live with, but because of this "everything is a command line" mess.



  • @antiquarian said in The Linux command line sucks:

    @scholrlea said in The Linux command line sucks:

    We've kind of discussed this. A lot. This thread is just one small part of that flamefest.

    See also https://what.thedailywtf.com/topic/12345/unix-haters-club.

    Linux sucks for a lot of reasons, but the reason why those reasons exist is the whole "never ever modify the existing design" philosophy.

    "Oh sure, maybe /etc/ is a stupid name but it works so why fix what ain't broken right? ¯\_(ツ)_/¯"



  • @lb_ said in The Linux command line sucks:

    everything is a command line

    Is not "everything" the invocation of a block of code with zero or more parameters (with the action(s) possibly impacted by pre-existing state??

    IF you answer NO - I would love to discuss exception...

    IF you answer yes, then why not have an interactive way to concisely express that (aka command line)?? [not, I am not dismissing the addition of other methods of invocation, merely looking for rationale behind reasons to exclude]


  • area_can

    @thecpuwizard said in The Linux command line sucks:

    with zero or more parameters

    Yeah but not every parameter is a string. Command line forces this


  • Notification Spam Recipient

    @bb36e There is actually one Linux shell that doesn't suck.



  • @gąska said in The Linux command line sucks:

    the Tortoises are all pretty good GUIs for their respective VCSs.

    Yes, they're just inferior to the CLI.



  • @pie_flavor said in The Linux command line sucks:

    @bb36e There is actually one Linux shell that doesn't suck.

    OK, but why link Powershell?


  • Notification Spam Recipient

    @boomzilla Because it's the one I was talking about.



  • @thecpuwizard said in The Linux command line sucks:

    @scholrlea said in The Linux command line sucks:

    both Applescript and HyperCard for writing automation scripts and with the macro recorder for repeating gestures.

    <<running and screaming>>

    For trivial stuff, that is OK, but try to do anything even moderately complicated and it quickly turns into a nightmare of unmaintainability.

    Having done relatively complex AppleScript automation and (UNIXy) shell scripting, I'd say they have about the same potential for unmaintainability. If you want to make it a mess, it'll be a mess.

    A side note about where Microsoft was at the time of Classic MacOS AppleScripting: they were expecting you to pay to license VBA and write COM IDispatch+ recording+script editing and embedding support into your application. IMHO, this was a huge failure on Microsoft's part. Nowadays you have free Visual Studio but nobody creates useful object models for their applications, assuming they aren't just a web browser in a box. Times change. 😞



  • @pie_flavor said in The Linux command line sucks:

    @boomzilla Because it's the one I was talking about.

    Oh, right, good one.


  • area_can

    @boomzilla what's wrong with powershell?



  • @bb36e I've never managed to get into it. Possibly a combination of verbosity and crap tooling (i.e., the console). I think the "NOT EVERYTHING IS A STRING" is another one of those things that isn't as big a deal as it's always made out to be, like listening to blakey rant about weird filesystem characters.


  • Fake News

    @boomzilla said in The Linux command line sucks:

    @pie_flavor said in The Linux command line sucks:

    @bb36e There is actually one Linux shell that doesn't suck.

    OK, but why link Powershell?

    Har har.

    I like Powershell, but I must admit that it's main feature "everything's more consistent than bash or cmd" might leave you stranded in Linux. It takes a switch of mindset because it's more of a .NET REPL rather than a shell built according to POSIX. None of the "paste this" help will work, and even "standard" Powershell might not work because .NET Core is still severely limited compared to the Windows-only .NET Framework.

    It is extensible though, and once you get it customized with things like PSReadLine, PoshGit, ZLocation, ... you can go to town (mind you, Pscx - PowerShell Community Extensions is another lifesaver, but it's not ready yet for the cross-platform Powershell).



  • @boomzilla said in The Linux command line sucks:

    @gąska said in The Linux command line sucks:

    the Tortoises are all pretty good GUIs for their respective VCSs.

    Yes, they're just inferior to the CLI.

    And for a good reason!


  • Discourse touched me in a no-no place

    @bb36e said in The Linux command line sucks:

    Yeah but not every parameter is a string. Command line forces this

    No, it does not enforce it. File descriptors can also be passed, and they're very much not strings as they are actually (handles to) active OS objects. Leaving that aside, you can pass pretty much anything you want as either serializable entities (this covers a very wide range of things) or as handles in a naming scheme (this covers filenames, URLs, dbus object IDs, etc). There's also schemes for mapping between various things, but that usually doesn't present a significant problem.

    If you're going to pick at problems, try discoverability, not expressibility. (Well, unless you count reading the documentation…)


  • Discourse touched me in a no-no place

    @parody said in The Linux command line sucks:

    nobody creates useful object models for their applications

    Of course not. That takes work. undefined



  • @thecpuwizard said in The Linux command line sucks:

    @lb_ said in The Linux command line sucks:

    everything is a command line

    Is not "everything" the invocation of a block of code with zero or more parameters (with the action(s) possibly impacted by pre-existing state??

    IF you answer NO - I would love to discuss exception...

    IF you answer yes, then why not have an interactive way to concisely express that (aka command line)?? [not, I am not dismissing the addition of other methods of invocation, merely looking for rationale behind reasons to exclude]

    The issue is the syntax. Programming languages like C++ almost never have the ambiguity and escaping shenanigans that command line scripts do. You never have to worry that someone will name a file with single quotes and wreck your script if you're coding in Java. It's a constant nightmare in shell script land.


  • Discourse touched me in a no-no place

    @lb_ said in The Linux command line sucks:

    It's a constant nightmare in shell script land.

    That's why you don't write significant programs in shell if you can help it. Fortunately, almost everyone's learned that already.



  • @dkf yeah but the brainworm is still everywhere. Try using ffmpeg's tee muxer to output to two files where one has a single quote in the name and let me know how that goes. Doesn't matter what shell you're using or how you launch ffmpeg, you have to escape various characters that the tee muxer cares about. The documentation even talks about double escaping. I have no idea how anyone thought this was an acceptable user interface.

    Similarly, if you have any files with square brackets in their names, good luck dealing with them in any capacity in CMake.


  • Discourse touched me in a no-no place

    @lb_ said in The Linux command line sucks:

    Try using ffmpeg

    CMake

    No thank you. 😉

    I freely admit that I'll build my own tools. I know a few languages reasonably well, and some of them are really quite capable indeed at handling complex component gluing tasks, much much better than shell. Where the shell is pretty good is where you want to just do something quick but a bit too fiddly to be nice in a GUI. Examining a single file? GUIs are good at that. Searching across a source repository for something where the criteria for selection of the files are programmatic? Tends to be a bit easier with a CLI. (The hard parts of those tasks take the same amount of effort either way.)

    The other thing that is good about a CLI is in interactive testing of code. Yes, you could spend a few months doing the most kick-ass GUI for testing your code that ever existed, but a quick cheap-ass CLI can be knocked out in a few minutes and lets you get on with being productive actually testing the real code in question.



  • @dkf said in The Linux command line sucks:

    Examining a single file? GUIs are good at that.

    But then so is less (for a text file).


  • kills Dumbledore

    @boomzilla said in The Linux command line sucks:

    I think the "NOT EVERYTHING IS A STRING" is another one of those things that isn't as big a deal as it's always made out to be, like listening to blakey rant about weird filesystem characters.

    I don't think everything being a string is a big deal, necessarily... but I did start working with PowerShell a bit and found that the alternative (getting properties from objects, easy one-liners for things that would have been a whole script, NO text manipulation) was freaking awesome.



  • @heterodox I agree. If I was doing some "serious" programming I wouldn't want to use bash. So I don't.

    I wouldn't argue much if people said that PowerShell was a better programming environment than bash, but this is like rating gas station sushi. It's all bad.

    However, I still like using the CLI for doing stuff.



  • @dkf said in The Linux command line sucks:

    a quick cheap-ass CLI can be knocked out in a few minutes and lets you get on with being productive actually testing the real code in question.

    So does GUI. It's 2018 for fuck's sake, every GUI framework has a GUI editor for GUIs that lets you put together a bunch of buttons and textbox about as fast as it takes to write CLI argument parser.



  • @boomzilla said in The Linux command line sucks:

    @dkf said in The Linux command line sucks:

    Examining a single file? GUIs are good at that.

    But then so is less (for a text file).

    I tend to use vim, but less works just as well.



  • @gąska said in The Linux command line sucks:

    @dkf said in The Linux command line sucks:

    a quick cheap-ass CLI can be knocked out in a few minutes and lets you get on with being productive actually testing the real code in question.

    So does GUI. It's 2018 for fuck's sake, every GUI framework has a GUI editor for GUIs that lets you put together a bunch of buttons and textbox about as fast as it takes to write CLI argument parser.

    Ok, but how fast can you write a script to interact with that GUI?



  • @bb36e said in The Linux command line sucks:

    • each application has its own interface...

    How does that not also apply to graphical applications? One could probably argue that graphical applications are even worse at this than command-line applications.

    • only method of discovery is manpages/foo --help (--help is not a recognized option: use foo -h)

    That isn't much worse than having to read through all of the options in a GUI, and pretty much identical to needing the graphical application's help pages. Just like with graphical applications, by far the biggest issue is how good or bad the documentation is.



  • @ben_lubar said in The Linux command line sucks:

    @boomzilla said in The Linux command line sucks:

    @dkf said in The Linux command line sucks:

    Examining a single file? GUIs are good at that.

    But then so is less (for a text file).

    I tend to use vim, but less works just as well.

    There is one specific aspect where less is better than vim, and that is large files. Vim, as an editor, will load the entire file into memory, and slow down significantly one the file gets larger than a few hundred MBs. These are usually high-verbosity log files or human-readable-ish data formats.

    For files on disk, I've successfully used less for files 10gb and up, though it doesn't scale as well when paging stdin.

    For completeness: The only slightly useful usecase of more I've found is in the form more *.txt | cat, with multiple small files (since it'll print a file name header). Even there there are probably better tools I haven't discovered yet.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.