DEV Community

Cover image for Terminal is your friend
Peter Vivo
Peter Vivo Subscriber

Posted on Edited on

Terminal is your friend

I work with javascript/typescript projects, some weird reason using terminal is significant part of my daily activity.

Sometime I almost forget which command are used. So I search which is the best way to document my important activity. My solution is extend any command with && echo :: <comment>. This is original bash solution, and easy to find by grep find below.

du -h -d 1 && echo :: size of directory
💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025 💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025
history 0 | grep ::
💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025 💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025

Alis can make your life easier. You can add following line to ~/.zshrc

alias h="history 0 | grep"

# or if use rg : rip-grep instead grep

alias h="history 0 | rg"
💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025 💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025

then you can wirte for example h clone to list your git clone links.

I use mac so I installed near every program by brew, and this is also help to remember outer application.

brew list
💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025 💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025
brew install zoxide
💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025 💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025

Few words about zoxide: this is hyperspace navigation throught directory.

zoxide hyper speed cd command

After installed for example to ~\.zshrc by this:

eval "$(zoxide init zsh)"
💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025 💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025

You can use as smart cd, for example I have repo directory so:

z re
💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025 💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025

Repair/install code command on MacOS

My worst experience when I try to fix vscode code . command by manually, and accidental ower defined my $PATH so I cant use even the basic ls command. A litle bit hard to fix it the problem, so I wrote this line to remember.

sudo /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron && echo :: VS Code with sudo rights for install 'code'
💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025 💬 ชาวเน็ตแห่แชร์: pengeszikra/terminal is you friend pna - Kapook Update 2025

VS Code SHIFT+COMMAND+P
vs code shift + command + P

Top comments (0)