Linux for Starters

Linux for Starters: Your Guide to Linux – Get Started with the Terminal – Part 9

Navigate the shell efficiently

The history builtin keeps a list of all the other commands that have been run from that terminal session, then allows you to replay or reuse those commands instead of retyping them. Using history effectively is an immediate productivity gain.

You can type history at the shell to see all the commands entered since you started the shell.

There are some simple ways to access history.

  • We can use the up and down arrows to browse the command history. This is an effective way to reuse a command that’s recently been entered.
  • The keyboard shortcut Ctrl+r lets us search the command history. The shell prompt changes to (reverse-i-search). Type letters to narrow down the search the most recent match display. We can keep pressing Ctrl+r to see other matches. There’s no need to remember long complicated commands.

There’s lots of other ways to improve the way we work with history. For example, in Page 3 of this article, we created an alias that lets us search for commands in the history reducing the number of characters to type to complete the search.

Another way to navigate the shell efficiently is to use the tab key. It shows suggestions or auto-completes a word or path.

Even though Ctrl+r is a time-saver, there is open source software which offer improved methods of navigating through your shell history. We recommend McFly, a tiny utility that replaces the functionality offered by Ctrl-r with an intelligent search engine. Unlike bash’s Ctrl-r, it also takes into account your working directory and the context of recently executed commands. The tool’s suggestions are prioritized in real time with a small neural network instead of a simple linear function. We also recommend fzf, a general-purpose command-line fuzzy finder.

We close this introduction to the shell with a list of all the shell builtins.

Page 6 – Appendix – Explanation of Shell Builtins

Pages in this article:
Page 1 – Types of Commands
Page 2 – Shell Builtins
Page 3 – Aliases
Page 4 – External Commands
Page 5 – Navigate the shell efficiently
Page 6 – Appendix – Explanation of Shell Builtins


All articles in this series:

Linux For Starters: Your Guide to Linux
Part 1What is Linux? Why use Linux? What do I need?
Part 2Choose a Linux distribution meeting your specific needs and requirements.
Part 3Make a bootable Ubuntu USB stick in Windows.
Part 4We show you how to install Ubuntu 21.04 on your hard disk.
Part 5Things to do after installing Ubuntu.
Part 6Navigating your way around the Desktop.
Part 7Updating the system, install new software.
Part 8Open source replacements for proprietary Windows desktop software.
Part 9Get started with the power and flexibility of the terminal.
Part 10We cover the basics of files and permissions.
Part 11Getting help from your system.
Part 12Learn all about the file system.
Part 13Manipulating files from the shell.
Part 14Maintain your system with these simple tips.
Part 15Managing users on your system.
Part 16Explore different desktops to GNOME 3.
Part 17Gaming on Linux.
Part 18Protect your privacy with this guide.
Part 19Access the Windows desktop from Linux using a remote desktop client.
Part 20Set up a virtual machine running Ubuntu as the host and openSUSE as the guest.
Part 21Wine lets you run Windows programs on Linux without emulation.
Share this article

2 comments

  1. This is for beginners? Every other word seems undefined. I can read Supreme Court briefs and medical research but not this! The most important thing unexplained is what can be accomplished with these commands. If someone is willing to talk to me to explain these things, I am willing to suggest easier explanations.

    1. Every other word seems undefined?? I think you should read more of the guide before coming to your discourteous comment.

      You’ll learn a lot from Part 11, as that shows you how to find what you can do with the commands.

Share your Thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.