Command Line

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:

sudo apt update && sudo apt upgrade -y

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:

sudo apt update && sudo apt upgrade -y

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.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

View Comments

Recent Posts

A Quick Look At The Shutdown Command

This is going to be just a quick article about a command many of you…

4 hours ago

Setting Up Coding Environments on Linux for Educational Use

With so many strong attributes, such as robustness and flexibility, Linux stands as a powerful…

2 days ago

View Detailed Hardware Information

There are many tools for showing your hardware information and today we'll get to view…

4 days ago

How To: Install Wine In Lubuntu

Today's article isn't going to be complicated or long as we are going to cover…

6 days ago

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

1 week ago

Save A Command’s Output To A File (While Showing It In The Terminal)

The title is the best I can come up with to describe this exercise as…

1 week ago