cdtmp

I have this line in my .zshrc:

alias cdtmp='cd `mktemp -d /tmp/frantic-XXXXXX`'

It’s a super simple alias that creates a temporary directory and then jumps into it. Here are a few examples of what I use it for:

  1. Clone a random interesting git repo to experiment with
  2. Fiddle with Flow: cdtmp && flow init and I have a working environment to narrow down a bug
  3. Play with unfamiliar node modules: cdtmp && yarn add xyz && node

I think cdtmp is partially a mental trick I use to reduce the barrier for trying new things and experimenting. I no longer need to make a name for my project or decide which folder to create it in. I also don’t have to deal with it later if I consider it not worth paying attention to anymore – the OS will clean it up at some point automatically.

Related posts:

Better way to switch between apps on macOS

Geek's guide to making decent slides

Show OSX notification when long running command finishes and your terminal is not in focus

My favorite shell shortcut

Hi! My name is Alex. I’m a software engineer at Facebook, where I work on React Native, Oculus and Messenger. I love thinking about development experience.

I write about programming, software design and side projects Subscribe