[Definitive Guide] The Ultimate Collection of Ubuntu Terminal Shortcuts – Supercharge Your Workflow!

Introduction

When using Ubuntu, working with the terminal is essential. For developers and server administrators, optimizing terminal operations is crucial.
By utilizing “Ubuntu Terminal Shortcuts,” you can reduce the effort of entering commands and significantly improve your work efficiency.

This article provides a comprehensive guide from basic operations for beginners to advanced shortcuts for experienced users.
Additionally, it covers customization methods and use cases to help you make the most of the terminal.

What You Will Learn from This Article

  • Basic Ubuntu terminal shortcuts
  • Useful time-saving techniques for intermediate and advanced users
  • How to customize shortcuts
  • Real-world usage scenarios

Benefits of Learning Shortcuts

  • Increased Input Efficiency: Quickly move the cursor and search history
  • Optimized Command Operations: Instantly execute frequently used commands
  • Reduced Workload: Minimize mouse usage and operate solely with the keyboard

Now, let’s dive into Ubuntu terminal shortcuts.

Essential Ubuntu Terminal Shortcuts (For Beginners)

If you are new to using the terminal, start by learning the basic shortcuts.
The following commands are frequently used in daily tasks, so mastering them will be highly beneficial.

Cursor Movement Shortcuts

Here are shortcuts for quickly moving the cursor while editing text in the terminal.

ShortcutDescription
Ctrl + AMove cursor to the beginning of the line
Ctrl + EMove cursor to the end of the line
Ctrl + BMove cursor left (same as the ← arrow key)
Ctrl + FMove cursor right (same as the → arrow key)

Text Editing Shortcuts

Here are shortcuts for quickly deleting and editing text.

ShortcutDescription
Ctrl + HDelete one character (same as Backspace)
Ctrl + DDelete the character under the cursor (same as Delete key)
Ctrl + WDelete the word to the left of the cursor
Ctrl + UDelete from the cursor position to the beginning of the line
Ctrl + KDelete from the cursor position to the end of the line
Ctrl + YPaste the most recently deleted text

Command History Operations

You can efficiently work in the terminal by referencing previously entered commands.

ShortcutDescription
Ctrl + PDisplay the previous command (same as ↑ arrow key)
Ctrl + NDisplay the next command history (same as ↓ arrow key)
Ctrl + RSearch for a specific command in history (reverse search)
Ctrl + GExit history search

Screen Control Shortcuts

These shortcuts help you manage your terminal screen efficiently.

ShortcutDescription
Ctrl + LClear the screen (same as the clear command)
Ctrl + SPause input temporarily
Ctrl + QResume paused input

Accelerate Your Ubuntu Terminal Workflow! (Intermediate Shortcuts)

Once you’re comfortable with basic shortcuts, it’s time to take on more advanced operations.
Learning shortcuts for process management and screen control will help you work more efficiently in the terminal.

Process Management Shortcuts

Managing processes efficiently is essential when working in the Ubuntu terminal. These shortcuts will help you handle tasks with ease.

ShortcutDescription
Ctrl + CForcefully terminate the running process
Ctrl + ZPause the running process
fgResume a paused process in the foreground
bgResume a paused process in the background

Copy & Paste

Copying and pasting in the terminal differs from standard keyboard shortcuts.

ShortcutDescription
Ctrl + Shift + CCopy text
Ctrl + Shift + VPaste text

Using these shortcuts will make your terminal work much smoother.

Advanced Ubuntu Terminal Shortcuts (Boost Productivity)

After mastering basic and intermediate shortcuts, it’s time to leverage advanced shortcuts to supercharge your terminal workflow.
By learning word-based movement, uppercase/lowercase conversion, and session management, you can work even more efficiently.

Advanced Text Editing Shortcuts

These shortcuts allow for faster text editing compared to standard cursor movements.

ShortcutDescription
Esc + BMove cursor one word left
Esc + FMove cursor one word right
Esc + UConvert text from cursor position to end of the word to uppercase
Esc + LConvert text from cursor position to end of the word to lowercase
Esc + CCapitalize the first letter of the word under the cursor
Ctrl + TSwap the two characters around the cursor

Terminal Session Management (Managing Multiple Windows)

If you often work with multiple terminal windows, these shortcuts will allow you to switch between them seamlessly.

ShortcutDescription
Ctrl + Shift + TOpen a new tab
Ctrl + Shift + WClose the current tab
Ctrl + PageUpSwitch to the previous tab
Ctrl + PageDownSwitch to the next tab
Ctrl + Shift + NOpen a new terminal window

Managing Background Processes

As an advanced user, you may often need to run multiple processes in parallel within the terminal.
These shortcuts will help you efficiently manage processes.

ShortcutDescription
Ctrl + ZPause the running process
bgResume the paused process in the background
fgResume the paused process in the foreground
jobsDisplay the list of background processes
kill [PID]Forcefully terminate a process with the specified PID

 

How to Customize Ubuntu Terminal Shortcuts

While Ubuntu terminal comes with many useful shortcuts, customizing them to suit your workflow can significantly enhance efficiency.
This section covers alias settings, .bashrc, and .inputrc customizations.

Using Aliases to Shorten Commands

Setting up aliases allows you to shorten frequently used commands and reduce typing effort.

Basic Alias Usage

Aliases enable you to call specific commands using a short custom name.
For example, you can shorten ls -la to ll like this:

alias ll='ls -la'

This command will be active only for the current session.

Making Aliases Persistent

To keep aliases active after restarting the terminal, add them to ~/.bashrc or ~/.zshrc.

  1. Edit .bashrc (or .zshrc):
nano ~/.bashrc   # If using Bash
nano ~/.zshrc    # If using Zsh
  1. Add the following lines at the end of the file:
alias ll='ls -la'
alias cls='clear'
alias grep='grep --color=auto'
alias gs='git status'
  1. Apply the settings:
source ~/.bashrc   # or source ~/.zshrc

💡 Tips

  • Setting alias grep='grep --color=auto' improves command output visibility.
  • Shortening Git operations with aliases like gs='git status' speeds up development work.

Editing .bashrc for Customization

The ~/.bashrc file is loaded when Bash (the default shell) starts.
By modifying this file, you can freely customize terminal behavior.

Customization Example ①: Display a Message When Opening the Terminal

To display a custom message when you open the terminal, add the following line to ~/.bashrc:

echo "Welcome to Ubuntu Terminal! Let's have a productive day!"

Customization Example ②: Automatically Change to a Specific Directory

You can configure the terminal to automatically navigate to a specific directory upon opening.

cd ~/projects

💡 Tips

  • For developers, setting up an automatic transition to ~/projects or other work directories can be convenient.
  • Adding clear at the end of .bashrc will clear the screen upon startup, providing a clean workspace.

Editing .inputrc to Modify Keybindings

To change key bindings in Bash, you can modify ~/.inputrc.

Customization Example ①: Assign Ctrl + T to Execute ls -la

Adding the following setting to ~/.inputrc will allow Ctrl + T to execute ls -la:

"C-t": "ls -la
"

To apply the changes:

bind -f ~/.inputrc

Customization Example ②: Modify History Search Behavior

By default, pressing Ctrl + R for history search retrieves past commands one character at a time.
Adding the following lines to ~/.inputrc will allow the entire matching command to be displayed immediately.

"e[A": history-search-backward
"e[B": history-search-forward

💡 Tips

  • Setting history-search-backward allows you to search history with just a few keystrokes.
  • Customizing keys like Ctrl + T lets you create your own shortcuts.

[Use Cases] How Professionals Optimize Terminal Workflows

Now that you’ve learned how to use and customize Ubuntu terminal shortcuts, how do professionals apply them in real-world workflows?
This section introduces practical use cases for developers, server administrators, and general users.

For Developers: Speeding Up Git Workflow

For developers, optimizing Git operations is crucial. Using terminal shortcuts can dramatically improve workflow speed.

Using Shortcuts for Git Workflow

ShortcutDescription
Ctrl + RSearch previous Git commands
!!Repeat the last command
alias gs='git status'Run git status using gs
alias ga='git add .'Run git add . using ga
alias gc='git commit -m'Commit using gc "message"

Efficiently Searching Git History

Using history search, you can quickly retrieve past Git commands.

Ctrl + R → Type "git"

💡 Tips

  • With Ctrl + R, you don’t need to retype long Git commands repeatedly.
  • Using alias simplifies complex Git operations.

For Server Administrators: Optimizing SSH & Log Management

For remote server management, efficient terminal usage is crucial.

Shortcut for SSH Connection

Instead of entering the server’s IP manually every time, you can configure SSH shortcuts in ~/.ssh/config.

Host myserver
    HostName 192.168.1.100
    User ubuntu
    IdentityFile ~/.ssh/id_rsa

This allows you to connect to the server with:

ssh myserver

💡 Tips

  • Shortening the server name reduces input effort.
  • Using Ctrl + Shift + T to open new tabs makes it easier to manage multiple servers simultaneously.

Simplifying Log Management

To monitor server logs in real-time, use tail -f.

alias logs='tail -f /var/log/syslog'

This allows you to check logs with just:

logs

💡 Tips

  • Using aliases like logs eliminates the need to type the full command every time.

For General Users: Making Terminal Work More Convenient

Even general users can benefit from shortcuts to improve efficiency.

Streamlining File Management

ShortcutDescription
llShortcut for ls -la (alias)
mkdir -pCreate nested directories in one command
rm -iPrompt confirmation before deleting files
mv -iPrevent overwriting when moving files

Conclusion

In this article, we explored how to optimize Ubuntu terminal usage with shortcuts.

Key Takeaways

Basic Shortcuts: Cursor movement, text editing, command history
Intermediate Shortcuts: Process management, copy & paste
Advanced Shortcuts: Complex text editing, session management, background process control
Customization: Alias settings, .bashrc, .inputrc modifications
Use Cases: Faster Git operations, efficient SSH & log management, improved file navigation

By leveraging these shortcuts, you can significantly improve your efficiency and save time.
Practice using them to make your terminal experience smoother and more productive.

In the next article, we will cover advanced terminal customization techniques and introduce new tools. Stay tuned!

年収訴求