Handy Keyboard Shortcuts for the Linux Bash Terminal

Use these Linux Bash shortcuts for navigation, modifying, command management, and quick access to historical past—all out there in a free cheat sheet.

person pressing keys on keyboard

The Linux Bash (Bourne Once more Shell) is a shell and command language that’s identified to most Linux customers, since it is the default shell in most Linux distributions.

A newbie Linux person might discover the Linux terminal utilization a bit exhausting to know, particularly as a result of it depends closely on utilizing your arrow keys to maneuver round. Moreover, continually re-typing the instructions, every with a slight variation, will be annoying.

Nonetheless, Bash comes with many easy-to-use keyboard shortcuts and historical past capabilities that guarantee environment friendly use of the terminal. For making efficient use of time, we’ve put collectively an inventory of probably the most generally used Bash keyboard shortcuts.

FREE DOWNLOAD: This cheat sheet is out there as a downloadable PDF from our distribution associate, TradePub. You’ll have to full a brief type to entry it for the primary time solely. Obtain the Linux Bash Terminal Cheat Sheet.

Linux Bash Terminal Keyboard Shortcuts

Shortcut Motion
Bash Navigation
Ctrl + A Transfer to the beginning of the command line
Ctrl + E Transfer to the top of the command line
Ctrl + F Transfer one character ahead
Ctrl + B Transfer one character backward
Ctrl + XX Change cursor place between begin of the command line and the present place
Ctrl + ] + x Strikes the cursor ahead to subsequent prevalence of x
Alt + F / Esc + F Strikes the cursor one phrase ahead
Alt + B / Esc + B Strikes the cursor one phrase backward
Alt + Ctrl + ] + x Strikes cursor to the earlier prevalence of x
Bash Management/Course of
Ctrl + L Just like clear command, clears the terminal display screen
Ctrl + S Stops command output to the display screen
Ctrl + Z Suspends present command execution and strikes it to the background
Ctrl + Q Resumes suspended command
Ctrl + C Sends SIGI sign and kills at the moment executing command
Ctrl + D Closes the present terminal
Bash Historical past
Ctrl + R Incremental reverse search of bash historical past
Alt + P Non-incremental reverse search of bash historical past
Ctrl + J Ends historical past search at present command
Ctrl + _ Undo earlier command
Ctrl + P / Up arrow Strikes to earlier command
Ctrl + N / Down arrow Strikes to subsequent command
Ctrl + S Will get the subsequent most up-to-date command
Ctrl + O Runs and re-enters the command discovered by way of Ctrl + S and Ctrl + R
Ctrl + G Exits historical past search mode
!! Runs final command
!* Runs earlier command besides its first phrase
!*:p Shows what !* substitutes
!x Runs current command within the bash historical past that begins with x
!x:p Shows the x command and provides it because the current command in historical past
!$ Identical as OPTION+., brings forth final argument of the earlier command
!^ Substitutes first argument of final command within the present command
!$:p Shows the phrase that !$ substitutes
^123^abc Replaces 123 with abc
!n:m Repeats argument inside a spread (i.e, m 2-3)
!fi Repeats newest command in historical past that begins with fi
!n Run nth command from the bash historical past
!n:p Prints the command !n executes
!n:$ Repeat arguments from the final command (i.e, from argument n to $)
Bash Modifying
Ctrl + U Deletes earlier than the cursor till the beginning of the command
Ctrl + Ok Deletes after the cursor till the top of the command
Ctrl + W Removes the command/argument earlier than the cursor
Ctrl + D Removes the character underneath the cursor
Ctrl + H Removes character earlier than the cursor
Alt + D Removes from the character till the top of the phrase
Alt + Backspace Removes from the character till the beginning of the phrase
Alt + . / Esc+. Makes use of final argument of earlier command
Alt + < Strikes to the primary line of the bash historical past
Alt + > Strikes to the final line of the bash historical past
Esc + T Change between final two phrases earlier than cursor
Alt + T Switches present phrase with the earlier
Bash Data
TAB Autocompletes the command or file/listing identify
~TAB TAB Record all Linux customers
Ctrl + I Completes the command like TAB
Alt + ? Show recordsdata/folders within the present path for assist
Alt + * Show recordsdata/folders within the present path as parameter


Loads Extra to Study About Linux

The Bash shell keyboard shortcuts work across the developer’s DRY (Do not Repeat Your self) philosophy. They assist make efficient use of your time by bettering productiveness in a fast-paced work atmosphere.

The above cheat sheet is simply the tip of an iceberg. The extra you start to discover Linux terminal instructions and Bash shortcuts, the simpler and extra fascinating Linux turns into.

The Linux Instructions Reference Cheat Sheet

This straightforward cheat sheet will enable you to get comfy with the Linux command line terminal very quickly.

Learn Subsequent

About The Writer

Leave a Comment