DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Terminal is your friend
Peter Vivo
Peter Vivo

Posted 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

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)

🌚 Life is too short to browse without dark mode