1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Create a Zsh Function to Rename Your Current Directory

    A common problem you'll run into when working inside of your terminal is the desire to rename the directory you're currently in. This is achieved in 3 steps: back out of the directory, mv to a new name, then back inside of it. Rather than 3 separate commands, let's take this down to a single command in a Zsh function. This lesson walks you through the process of creating a Zsh function to rename your current directory by using ${PWD##*/} to find the name of the directory your in then walking through the steps.