Terminal hacks every developer should know
If there is one tool that every developer uses regardless of language, platform, or framework is it’s the terminal. Getting better at typing commands on a terminal can be a huge productivity boost.
I find following shortcuts very useful in day-to-day activity.
Move to Front or End of a command
- Ctrl + e —Moving cursor to end of line.
- Ctrl + a — Moving cursor to beginning of line.
Searching through previous commands
Every shell implementation has “history” command which returns a list of previous commands as output. You could then copy, paste and run it. Shouldn’t there be a smarter way of doing it ?
Following commands can help you do it in a much better manner.
- Ctrl + r — Reverse search in the history of commands executed.
Kill and Yank Operations
- Ctrl + k — Cut all characters post the cursor.
- Ctrl + u — Cut everything before the cursor from the start of the command line.
- Ctrl + w — Kill the word from cursor backwards.
Common Usages
- Ctrl + w — Typical use-case is when you make a spelling mistake while typing something really fast. Rather than doing multiple backspaces, a direct Ctrl+w is a huge saviour.
It may seem a little difficult to incorporate them in your day-to-day operations but your aim should be to keep them always in your mind-cache. Fetch them as and when you come across a problem where you can use it.
Write your response if you know some of the cool terminal hacks which can boost productivity!