Monday, May 27, 2024
HomeDeveloperUseful command line keyboard shortcuts

Useful command line keyboard shortcuts

Date:

Related stories

Luck or Skill? Unraveling the Mysteries of Slot Machine Odds

Slot machines, with their flashing lights, mesmerizing sounds, and...

Elevate Your Game: Exclusive Insights from the Top Poker Site

In the fast-paced world of online poker, the quest...

Embark on an Adventure with BigWin138: Your Passport to Betting Fun

Introduction Embark on an adventure like no other with BigWin138,...

Unleash Your Luck: Togel Rakyat Slot Game Extravaganza

Introduction Welcome to the ultimate gaming experience where luck meets...

Placing Bets Stateside: A Guide to Online Casinos in the USA

In the ever-evolving landscape of online entertainment, online casinos...
spot_img

I use these bash keyboard shortcuts every day and they save me plenty of time, so I find them worth sharing. Even if you’re developing on Windows, you can have (similar) experience of the Linux bash using the Cygwin tool.

CTRL + R, then arrow up/down
Search in the history of bash commands. Press CTRL + R, type a couple of letters, and the most recent matching command jumps out of history. Press CTRL + R again, and you get older result matching your search string. Once you find your command, you hit either Enter to execute the command directly from reverse search, or any other key to keep it in the command line and be able to edit it (I usually use ESC or right/left arrow or the End key). I use this all the time to recall my previous mysql and ssh commands, or other ones which are too long to type. You can use any keyword inside the command when searching.

Arrow Up / Down
Load previous / next commands from the bash history.

TAB
Autocomplete for commands or filenames. Type first letter(s) and hit TAB. If there are multiple choices matching your first letters, hit TAB again to see the list of them.

CTRL + Arrow Left / Right
Move the cursor word-after-word in the command line. On Mac OS X: ALT + Arrow Left / Right, or ESC + B and ESC + F.

HOME or CTRL + A
Move cursor to the beginning of the line. Only CTRL + A on Mac OS.

END or CTRL + E
Move cursor to the end of the line. Only CTRL + E on Mac OS.

CTRL + K
Delete everything after the cursor (right to the cursor).

CTRL + U
Delete everything before the cursor (left from the cursor).

CTRL + W
Delete only 1 word immediately before the cursor.

CTRL + Y
Undo a deletion, sometimes useful.

CTRL + L
Clear screen, works like the “clear” command.

CTRL + C
Kill the current process.

CTRL + D
Pressed on an empty line: log out from the current terminal. Works pretty much the same as the “exit” command.

Do you have any other favorites which are not mentioned here? Feel free to share them in the comments.

Latest stories

spot_img