Navigating in the Linux File System

In pair programming instances, I got tired of typing ../ when using cd. The extra seconds add up over time. Of course, a quick google search revealed a number of solutions to speed this up.

up

There are a number of more advanced solutions such as z or a combination of find or locate with fzf that I now use that allow me to move around quickly in the filesystem. I still wanted a separate simpler solution. Essentially, the use of .. for the cd argument could be replaced with an integer. Instead of implementing something of my own, I found up.

Instead of cd ../../.., I now use up 3.

Bonus

Given PWD is something like .../src/routes/Counter/components, then I can use up routes to end up in .../src/routes. It also supports partial directory names and comes with autocompletion!

References


© 2019. All rights reserved.