
11 hot terminal features you might not know about
If you’re still not sure that CLI (console line interface) is better than GUI, then you just don’t have enough practice with it.
I’ll help you to learn some of my best stuff that I’ve been gathering for years. And it will take you only 5 minutes to learn it all. Awesome! Let’s go.
1. ctrl
+ d
Closes current session. It’s very handy to use with remote servers. You don’t need to type exit
anymore.
Works in: every Bash terminal.
2. ctrl
+ u
Erases current line from cursor to the beginning. It’s convenient to quickly clear your input if you changed your mind about executing some command.
Works in: every Bash terminal.
3. cmd
+ r
Clears the screen. In iTerm2 this shortcut works like clear
command. I use it all the time, for example, when viewing logs with tail -f file.log
.
Works in: iTerm2 only.
4. Fixing alt + arrow in iTerm2
It’s a thing that you really should know if you are using iTerm2. For some reason it doesn’t understand alt
+left arrow key
combination out of the box. The same with the right key. In case you don’t know, it’s a native macOS shortcut to quickly move the cursor from word to word. Thanks to Edward Robinson’s post we can fix it like this:
- Preferences → Profile → Default → Keys
- Choose Left option (⌥) Key acts as: +Esc
- Double-click on ⌥← hotkey, for Action, choose send to escape sequence and write b
in the input field.
- Double-click on ⌥→ hotkey, for Action, choose send to escape sequence and write f
in the input field.

Works in: … It is a kind of a bug that I’ve seen only in iTerm2. So yes, it works only in iTerm2! 😀
5. ctrl
+ a
and ctrl
+ e
Jump to the beginning or to the end of the line respectively. Very-very convenient feature.
Works in: iTerm2 only.
6. Auto-copy selected text
Don’t you know that every selected text is automatically copied to your clipboard? There is no need to do cmd
+ c
anymore, just select anything, that’s all!
Works in: every Bash terminal.
7. Opening files straight in your editor
Isn’t it cool when you can cmd
+ click literally any filename in your terminal and straight open it in your editor? You can do it easily for all the major editors in Profiles → Default → Advanced → Semantic History.

And what about IDE? Something like PhpStrom or IDEA? You can do it too with Raul’ good advice. Although I use PhpStorm all the time I still prefer to open files from the terminal in Atom or VS Code not in IDE.
Works in: iTerm2 only. But I’m sure that you can tune it in other major terminals somehow.
8. alt + shift + up
This command works only when the iTerm2 shell integration is enabled. With that you can jump between input commands that you executed earlier. It allows you, for example, not to scroll a long cat
command’s output and go straight where you need.

Works in: iTerm2 only.
9. alt + .
Yes, alt
+ dot
. It’s another trick that I use all the time. It is getting last argument from the previous command and paste it where cursor is. It is extremely useful when you do a few operations with one file or folder and you don’t want to type it every time.
Works in: every Bash terminal.
10. cmd + shift + A
It’s a nice hint to copy output from the previous command. I use it every time I need to copy the content of a file. I do cat file
then just copy the output. Easy and quick.
Works in: iTerm2 only.
11. History with dates
If you ever tried to run history
command, then you noticed that there is a plain list of commands without dates. Or those dates are all wrong. You can fix it!
Just add that to your ~/.bashrc
:
export HISTTIMEFORMAT="%d/%m/%y %T "
Then restart terminal (or source
the file) and you’re done!
Works in: every Bash terminal.
Conclusion
That post is just a collection of random terminal tricks so if you know some more please put it in the comment. Let’s help each other to get smarter and more productive.
Thanks!
Join our community Slack and read our weekly Faun topics ⬇