• electric_nan@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    In bash if you type the verb, then hit tab it will list the possible options, right? Is that not the same kind of thing?

    • lightnsfw@reddthat.com
      link
      fedilink
      arrow-up
      1
      ·
      1 day ago

      Tab completion isn’t really what I’m talking about here. Powershell’s intuitiveness comes from the ease of finding the command you need. For instance if you type “copy” into bash and hit tab you’re not going to get anything. That’s because the command for copying a file in bash is “cp”. Now, how do you find that out using only the shell? You can use apropos, but who’s going to be able to figure that out without a web search? I had to try several variations of “find commands in bash” just now to get Google to mention it. Most things in bash are like this, there’s no real naming convention and most of the time the names are pretty meaningless by themselves. It’s a big barrier for people who are new to it or only use it sporadically.

      Conversely, typing “copy” into powershell and hitting tab you will get a number of options which shouldn’t take much for a beginner to locate copy-item from there or you can find it via the previous methods I mentioned.

      • electric_nan@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        I genuinely think you may just be more familiar with PS. I use “Get-Printer” all the time, but it’s not like I was able to discover that command or syntax without web searches. Same with “cp” in bash. I had to learn it and use it, but I’m never going to forget it now. Something that seems inconsistent/unintuitive to me in PS, is some commands specify an object with:

        -Name ="the name"
        

        Other times it’s like:

        Name "the name"
        

        I keep a notebook handy for things that I use as frequently as several times a week.

        • lightnsfw@reddthat.com
          link
          fedilink
          arrow-up
          1
          ·
          1 day ago

          Searching commands online is a perfectly valid way to find things, especially if you don’t know how to discover them within the shell. My point is that powershell is fantastic for that and bash is not. Years ago, I read maybe 1/3 of a powershell book and it was enough to set me off and figure most things out on my own from there. It’s rare I have to go online to find something. I’ve read/watched quite of bit of bash content over the years and I can’t say the same. I still struggle with it or have to go back and check my notes all the time. I am more familiar with powershell but I’ve been using bash quite a bit longer. For me that highlights what I’m talking about here in terms of intuitiveness.

          As for the inconsistency issue, I’m sure there are inconsistencies in either shell but I’d need more information to explain this one, the only time I can recall something like what you’re referring to would be commands where -Name is a parameter, vs something like a -Filter parameter where you entering name as what you’re filtering for but that would need more than -Filter Name “name” to work(I think). For the most part I find powershell to be very consistent once you understand what’s going on. Bash as well, but it’s harder to get to the “understand what’s going on” stage.