Skip to main content

5 posts tagged with "CLI"

View All Tags

Cron jobs that don't suck

To run cron jobs with your user env so that it's actually possible for them to run anything, add this to the top of your cron file (edit with crontab -e):

SHELL=/bin/bash
HOME=/home/<username>
BASH_ENV=$HOME/.bashrc

Then look at your ~/.bashrc file and make sure to remove any code (usually at the top) that exits early if found in a non-interactive shell.

Making Your Terminal Awesome

The tools we use as developers make us more effective (or at least hopefully faster) developers. So why not spend some time to make one of the most common dev tools much more useful? Here's a way to give any terminal app a personalized and awesome experience (fwiw I use the default app included with macOS). Features covered will be the following:

  • a super informative and customizable prompt
  • per-directory prompt customization
  • automatic switching of Node.js versions (easily extended to any run-time)
  • better auto complete and history
  • optional "command done" chime

Open Multiple Files in VS Code from a Grep

A simple script:

grep -rl '<search-string>' <search/dir> | xargs code -r

Between two different directories:

cd <first-path> && grep -rl '<search-string>' <search/dir> | (cd <second-path>; xargs code -r)