Access VS Code via the Terminal

To access and open VS Code directly from your terminal, do the following: Open your Bash or zsh profile. open ~/.zshrc Add path to the VS Code application to your PATHS variable. # Add Visual Studio Code (code) export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin" Reload your updated terminal profile. source ~/.zshrc You can now open VS code by running code xxx from anywhere in your computer. References: https://code.visualstudio.com/docs/setup/mac

 March 17, 2025  •   1 min  •   66 words  •   Suyog Garg

pdf2jpg via terminal

How to convert PDF to JPG/PNG (images) via command line prompts on MacOS zsh terminal. STEP 1 : Install poppler via brew install poppler STEP 2a : If you only wanna convert one file, run, pdftoppm -jpeg -r 300 path-to-input-folder/**/*.pdf path-to-output-folder/* STEP 2b : If you wanna loop through all the files in then execute, for file in path-to-input-folder/**/*; do pdftoppm -jpeg -r 300 $file path-to-output-folder/*; done; See also : https://stackoverflow....

 March 22, 2024  •   1 min  •   71 words  •   Suyog Garg

Customizing Mac Terminal

Update 2025/04/24 Changed to eza instead exa for alias for ls commands with icons, because the exa package is no longer supported. Thus, # map exa commands to normal ls commands alias ll="eza -l -g --icons" alias li="eza --icons" alias lt="eza --tree --icons -a -I '.git|__pycache__|.mypy_cache|.ipynb_checkpoints'" The full ~/.zshrc file now is: # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation....

 February 3, 2023  •   8 min  •   1555 words  •   Suyog Garg