DEV Community

Cover image for Best Tips for Iterm2 Mac
Javid Mougamadou
Javid Mougamadou

Posted on • Edited on

Best Tips for Iterm2 Mac

Open Quickly (⌘+⇧+O)

Image-3

You can quicly open a window or a tab with Profiles. You can also open a workspace which contains multiple window with Arrangements.

Profiles

Image-2

You can save a terminal window with the Profile Section. (Example Backend Profile, Frontend Profile, Database Profile, Bash Profile, etc)

SSH Profile

You can override the command sent at window startup like an ssh connection.



Sent text at start : ssh admin@myhost.com

Enter fullscreen mode Exit fullscreen mode




K8S Profile - PS1

You can override the command sent at window startup in order to inialize the K8S context.



Sent text at start : source "$(brew --prefix)/opt/kube-ps1/share/kube-ps1.sh";PS1='$(kube_ps1)'$PS1

Enter fullscreen mode Exit fullscreen mode




Screenfetch

Image-Screenfetch

You can override the command sent at window startup in order to launch the screenfetch.



Sent text at start : screenfetch

Enter fullscreen mode Exit fullscreen mode




Arrangement

Image-Arrangement

You can save a workspace which contains multiple window with Arrangements.

Open it with Restore from Arrangement.

Markers and Annotations

Image-Annotation

You can add annotations via (⌘+⌥+M).

You can add markers via (⌘+⇧+M).

Shortcuts

Iterm

Clear Buffer (⌘+K)

Show Iterm2 History (⌘+⇧+H)

Bash

!! : Execute the last command typed

!top : execute the most recent command that starts with ‘top’ (e.g. !).

![value] : Execute the last command typed that starts with ‘value’

Ctrl+R : Interactively search through previously typed commands

history n : Shows the stuff typed – add a number to limit the last n items

Badges (Optional)

Image-1

The badge's color may be set in Preferences>Profiles>Colors.

Change the Badge to (session.username)@(session.hostname).

Other Links

Cheat Sheet

https://gist.github.com/poopsplat/7195274

https://webstudiya.com/develop-faster-with-iterm-profiles-and-window-arrangements/

https://www.tecmint.com/linux-command-line-bash-shortcut-keys/

Top comments (0)