Navigate To The Start Or End Of The Line (In The Terminal)

Today is going to be another simple article, where you learn to navigate to the start or end of the line – in the terminal, of course. I’ve had some abdominal issues, so it seems like a good day for yet another accessible article.

Even though it’s an easy article, there will be many Linux users who don’t know this information. I’m not even sure how to describe it, thus the unwieldy article headline. So, if you want to navigate to the start or end of the line in the terminal, I’ll show you how.

This being Linux, there are so many ways to do this sort of stuff…

Imagine this:

You’re using Ubuntu and you want to update from within the terminal. So, you’ve typed the following:

Well, as you can see, the first instance of ‘sudo’ was spelled wrong – it’s missing a letter. You can reach over there and find the arrow buttons, navigate back to the start of the line, and fix it. Or, you can do the following:

Navigate To The Start Or End Of The Line:

As the title indicates, this is in the terminal. As such, you’ll need an open terminal to try this out. Just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, why don’t we just use that line from above:

Of course, you could just look at your keyboard and (probably) use the HOME button to navigate to the start of the line. Of course, you could then use the END button to navigate to the end of the line. If you’re on a laptop, those keys can be placed most anywhere, though it’s far more standardized with a regular keyboard.

But, you don’t have to reach for those lines. Nope. That is not necessary. You can keep your eyes right on the screen. How so?

Well, it’s this easy:

To navigate to the start of the line, press CTRL + A.

To navigate to the end of the line, press CTRL + E.

Tada! You don’t have to root around for the home or end buttons. You don’t have to fuss with the arrow buttons. You can quickly and easily navigate to the start and end of the line with just those two keyboard shortcuts. I told you that it’d be quick and easy!

Closure:

There you have it, you have another article. This one is pretty simple but that’s okay. So long as it’s sharing some knowledge and I managed to get an article out on schedule, it’s all good by me. This time, you’ve learned how to navigate to the start of end of the line – in the terminal and without taking your eyes off the screen.

You might as well memorize the shortcuts as they appear to be pretty universal from my testing. They’ll likely be faster for you than any of the other methods, so they’re worth learning and adding to your growing toolbox of Linux tools. Ideally, my ailments will go away soon… I’m hopeful…

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.