DEV Community

Cover image for Terminal is your friend
Peter Vivo
Peter Vivo

Posted on • Updated 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
Enter fullscreen mode Exit fullscreen mode
history 0 | grep ::
Enter fullscreen mode Exit fullscreen mode

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"
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode
brew install zoxide
Enter fullscreen mode Exit fullscreen mode

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)"
Enter fullscreen mode Exit fullscreen mode

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

z re
Enter fullscreen mode Exit fullscreen mode

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'
Enter fullscreen mode Exit fullscreen mode

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

Top comments (0)