You are not logged in.

#1 2016-07-01 06:19:51

ninjaaron
Member
Registered: 2010-12-10
Posts: 296

dirlog: the greatest shell utility since `cd`

cower in terror.

dirlog is a wrapper for cd that keeps a database of all the directories you visit, so you only have to type the first few letters of the basename to get back to them the next time. It also provides a mechanism for wrapping other commands to take advantage of this database. If you "live in the terminal," this will revolutionize your life. or something. You'll at least have to type less.

PKGBUILD:
https://aur.archlinux.org/packages/python-dirlog/

github:
https://github.com/ninjaaron/dirlog

You can also download it from PyPI with pip.

Comments, feedback, bug reports etc. are welcome!

Offline

#2 2016-10-05 03:40:18

z1lt0id
Member
Registered: 2012-09-20
Posts: 177

Re: dirlog: the greatest shell utility since `cd`

Hey ninjaaron,

Just want to say I've been using your dirlog util for a while now and its great - especially cause I want to be lazier on auto-completing directory structures.  Just thought I'd say great job smile

Offline

#3 2016-10-05 06:13:58

likytau
Member
Registered: 2012-09-02
Posts: 142

Re: dirlog: the greatest shell utility since `cd`

How does this compare with z?

(so far, the only difference I'm sure about is : dirlog provides a Python API. I suspect also, that dirlog's handling of multiple arguments is different.)

Last edited by likytau (2016-10-05 06:19:38)

Offline

#4 2016-11-13 09:47:10

ninjaaron
Member
Registered: 2010-12-10
Posts: 296

Re: dirlog: the greatest shell utility since `cd`

likytau wrote:

How does this compare with z?

(so far, the only difference I'm sure about is : dirlog provides a Python API. I suspect also, that dirlog's handling of multiple arguments is different.)

just glancing quickly at the readme, there are a few differences. dirlog is very "stupid". It only cares about history, not any of this "frecency" stuff. I tend to find this behavior preferable, but ymmv.

The other clear difference is that dirlog doesn't use regex. it only tries to match the string you give it to the beginning of basenames in your history.

There are other projects which do similar things (I forget their names at the moment...). The main distinguishing factor of dirlog is that it does less, is less "intelligent" and it's in Python. I consider these its killer features!

Oh, yeah, dirlog also provides the `dlog` command wrapper, so you can use your history in other commands. You can do something similar, it looks like, with `z -e`, it's just a different mechanism.

Last edited by ninjaaron (2016-11-13 09:50:31)

Offline

#5 2016-11-13 09:51:02

ninjaaron
Member
Registered: 2010-12-10
Posts: 296

Re: dirlog: the greatest shell utility since `cd`

z1lt0id wrote:

Hey ninjaaron,

Just want to say I've been using your dirlog util for a while now and its great - especially cause I want to be lazier on auto-completing directory structures.  Just thought I'd say great job smile

Thanks! glad you like it!

Offline

#6 2016-11-13 12:03:35

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 652

Re: dirlog: the greatest shell utility since `cd`

When I first started working on Unix in the late 80's I wrote a similar faciliy cdhist and have used it pretty much daily ever since. I've never understood how others can get by without something similar.

I originally coded it in Korn shell (ksh) but ported it to Python about 15 years ago. It's pretty much the first thing I install the moment I have to start using any new Linux box.

Offline

#7 2016-11-13 13:40:13

ninjaaron
Member
Registered: 2010-12-10
Posts: 296

Re: dirlog: the greatest shell utility since `cd`

bulletmark wrote:

When I first started working on Unix in the late 80's I wrote a similar faciliy cdhist and have used it pretty much daily ever since. I've never understood how others can get by without something similar.

I originally coded it in Korn shell (ksh) but ported it to Python about 15 years ago. It's pretty much the first thing I install the moment I have to start using any new Linux box.

Yeah, I originally wrote it for any POSIX compatible shell (and ported it also to Fish for a friend of mine), but it got up around 25 lines and I realized it was time for Python.

There are a lot of projects like this. I think it's a very natural thing to try to do. In fact, so many people have done this very thing, I'm sort of surprised it's not baked into some alternative shells like fish or zsh. (I think there is actually some kind of directory history built into zsh, but it's not so easy to use and, well, it's obviously only for zsh!)

Offline

#8 2016-11-13 13:55:38

Awebb
Member
Registered: 2010-05-06
Posts: 6,285

Re: dirlog: the greatest shell utility since `cd`

bulletmark wrote:

I've never understood how others can get by without something similar.

I have not used tools like this, since the day I learned about "cd -" on top of pushd/popd.

Offline

Board footer

Powered by FluxBB