Maybe there is a tool that does that? Maybe I'm doing this all wrong and there is a different way I should browse?

you are viewing a single comment's thread
view the rest of the comments
[–] 10 points 1 day ago* (5 children)

What I do is: Up, Home, type cd , Delete (hold/repeat as many times as needed), Enter.

The Home key instantly brings your cursor to the start of the command line (before the ls), even if the command is long enough to wrap.

I'm not a terminal guru, and I don't aspire to become one. I don't want to memorize arcane symbols that each has a subtly different meaning, and I especially don't want to execute them before I see explicitly what they're going to do. So while the top comment of cd !$ is a perfectly good and correct answer, I offer this alternative in case you, like me, like to see what you're doing as you do it. Home and End are pretty good.

  • source
  • hideshow 5 child comments
  • [–] 5 points 1 day ago

    The seconds I’d save remembering which combination of dollar signs and exclamation points to use would never help me find a better job or otherwise improve my life. I’m okay with the up arrow too.

  • source
  • parent
  • [–] [S] 6 points 1 day ago (3 children)

    I had already found ctrl+a that brings me back to the front of the line. It's bit more convenient for my hands than home.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 5 points 1 day ago (1 child)

    I have a really strong muscle memory for Home so it's super convenient to me, but ctrl+a sounds just as good.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 1 day ago

    Minor addition: I've had some shells where home will bring you back to the beginning of the current line, not the whole command. Ctrl+Home always brings you to the very start of the command if this applies to you

  • source
  • parent