Jaymon / .bash

common bash functions and aliases I've written/accumulated over the years

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

directory stuff

Jaymon opened this issue · comments

I think the qcd command should become a little more fully featured, so:

$ qcd recent

Would display the most recent directories

$ qcd saved

Would display the ones that are explicitly saved (which is current functionality). And

$ qcd visited

would display the most visited.

So the idea would be to have qcd run every time the prompt is printed and then track the directories.

Directories could be tracked by greping for the directory in a file with format

N /path

So you would grep and cut to find N, then increment it and then append that path back on the bottom (removing it from anywhere else in the list by using grep -N). So to display the most recent you just tail the file, to display the most you just sort the file.

$ qcd git

move up the directory tree until you find the folder with a .git folder