Linux how-to guides often expect you to perform certain operations in the terminal, which can seem intimidating at first. But fret not; this Linux command cheat sheet will cover the process of opening a terminal and issuing a few useful commands.

Linux Command Prompt for Beginners

The basic Linux commands you'll find below are universal to almost any Linux distribution, from the Ubuntu command line to Kali Linux. Your terminal might look different than the one in the pictures below, but rest assured these will work for you.

Note that in various online guides, you'll often hear different phrases referring to the same action: "open a shell," "start bash," or "in the command line." They all mean that you should open and type in the terminal, which we'll do below.

Read More: What Does "Bash" Mean in Linux?

How to Open a Terminal in Linux

Search your application menu for terminal. It will often have the label "terminal emulator," and this is exactly what you want.

An Open Terminal in Linux Mint

The quickest route to opening a terminal, however, is the keyboard shortcut Ctrl+Alt+T.

Basic Linux Commands for Beginners

Now that you have a terminal open, you're ready to start issuing some commands. Let's review a few of the most basic shell commands in Linux.

1. View Working Directory

Knowing the current "working" directory is of utmost importance when using the terminal. Many commands cause changes to happen in the current directory, and you don't want to make those changes in the wrong directory.

To check which directory you're currently working in, this command will print the working directory:

        pwd
    

View Contents of the Working Directory

Issue the ls command if you want to view all files and folders in the current directory:

        ls
    

Files will appear in plain text, while folders will be in bold and colored.

Using the Ls Command in Linux Mint Terminal

If you want to see hidden files too, simply append the -a or --all option:

        ls -a
    

2. Change Directories

You can change your current working directory with cd, an abbreviation for change directories.

        cd Documents
    

The above command will look for the folder called Documents inside your current working directory and, upon finding it, change to that directory.

Related: How to Find a Directory in Linux

Be sure whenever you specify a file or directory whose name has a space in it that you put it in quote marks, or else you'll get an error.

You can move one up one directory by adding the .. option:

        cd ..
    

Issuing cd on its own, without a location specified, will take you directly to your home directory:

        cd
    

The echo command will take whatever input you give it, be it a string of text or another command, and print it out in the terminal.

        echo "Hello, world!"
    

On its own, echo might seem useless, but you will in fact see it used frequently in Linux system management.

View File Contents

The feline-sounding command cat will print in the terminal the full contents of any file you name.

        cat filename.txt
    

4. Search a File's Contents

To search any file's contents for a specified word or phrase, use the grep command.

        grep "search term" filename.txt
    

This command is very helpful when you're looking for specific information among lengthy and complex system files.

5. Redirect Command Output

The "greater than" symbol, >, has the power in command strings to redirect the output of a command into a file or another command.

For example, this command will take the output of echo and save it in a plaintext file called "file.txt":

        echo "Hello, world!" > file.txt
    

6. System Update (Ubuntu-Based Systems)

In any Ubuntu shell, enter these two commands to check for and apply all available updates to your system.

        sudo apt update

sudo apt full-upgrade

You'll be prompted for your user password before confirming any command with the sudo prefix.

Pro tip: You can string two or more commands together into one using the && operator.

        sudo apt update && sudo apt full-upgrade
    

Linux Terminal Keyboard Shortcuts for Beginners

Learning keyboard shortcuts, while difficult at first, saves a tremendous amount of time in the long term. Linux has a lot of useful shortcuts, and we'll list a few of the most helpful terminal shortcuts below.

7. Recall Previous Commands

If you want to repeat a command you recently used, but you don't remember it or don't want to type it out again, you can scroll through your command history using the up and down arrow keys.

Alternatively, you can hit Ctrl+R to search your command history for a specific keyword or phrase.

8. See Command Suggestions

Sometimes when using the terminal, you'll recall part of a command, but you won't be quite sure how it's spelled or what options to use. If you start typing a command then hit the Tab key, the terminal will try to finish your command for you, or show you several possibilities.

Viewing Command Suggestions in Linux Mint Terminal

9. Kill a Terminal Process

You might already know Ctrl+C as the copy-to-clipboard shortcut, but when used in the terminal, this key combination kills any running command you might regret issuing.

Linux for Beginners

The best way to memorize these starter Linux terminal commands and shortcuts is to use them, so open up the command line and start typing!

Want more commands? Take a look at our Linux commands cheat sheet.

To help you discover what's possible in Linux, we've put together a deep-dive into the best software available for Linux, organized by category.