from Hacker News

Z – quickly cd to 'frecent' directories

by mrswag on 12/12/15, 1:17 PM with 49 comments

  • by athenot on 12/12/15, 2:57 PM

    That's a useful feature. I've recently switched to fish shell and it has similar fuzzy autocomplete which turns out to be more useful that I thought.

    http://fishshell.com - Fish Shell

    http://fishshell.com/assets/img/screenshots/autosuggestion.p... - Unintrusive autocomplete, thanks to coloring.

  • by rsoto on 12/12/15, 2:20 PM

    As it seems z is somehow abandoned, I'd like to recommend autojump[1]

    1: https://github.com/wting/autojump

  • by kazinator on 12/12/15, 5:13 PM

    I wrote something called pcd.

    https://news.ycombinator.com/edit?id=10723381

    If you are currently in "a/b/c", then "pcd x" will try to change to "a/x/c", "pcd x 0" to "a/b/x", "pcd x 2" to "x/b/c".

    pcd is helpful if you are working in a directory tree with parallel structures. You're in "proj/parser/src" but need to be in "proj/iolib/src". Just "pcd iolib".

  • by fredwu on 12/12/15, 2:45 PM

    There is also Fasd: https://github.com/clvv/fasd
  • by dmd on 12/12/15, 6:26 PM

    My coworker Andy is a former Bell Labs unix guy, and incredibly resistant to change; when I introduced him to z after a few days he described it as "the first new unix command I've introduced to my regular workflow in 20 years".

    (Disclaimer: z's author is a close friend.)

  • by manojlds on 12/12/15, 2:34 PM

    Plug - for Powershell users out there - https://github.com/manojlds/posz
  • by stewbrew on 12/12/15, 3:59 PM

    z is cool because it is just a bash script with no dependencies and because it is simple -- just one command. Most of the time it guesses the right directory. When it doesn't, it can be slightly cumbersome though to make it jump to the right directory.
  • by jdowner on 12/12/15, 3:20 PM

    This was my effort (in python) to solve this problem https://github.com/jdowner/cdhistory
  • by tehwalrus on 12/12/15, 3:16 PM

    I use this everyday at work; no idea how I survived without it before!
  • by frou_dh on 12/12/15, 4:16 PM

    You can get part way to this sort of experience in standard bash/sh by setting up a thoughtful 'CDPATH' and also making use of 'cd -'. In fact I have the latter aliased as z because it's like Undo.
  • by krylon on 12/12/15, 2:53 PM

    Mmmmh, I had never tought of something like this. It is amazing how people, after all this time, still come up with new ideas.

    zsh allows me automatically maintain a directory stack. But having one based on prior behaviour sounds awesome.

  • by pmoriarty on 12/12/15, 5:22 PM

    Not quite the same, but I highly recommend cdargs.[1]

    It's like a simple bookmark manager for your favorite directories.

    [1] - http://www.skamphausen.de/cgi-bin/ska/CDargs

  • by idomin on 12/12/15, 3:37 PM

    Been using z for a couple of months now and I really recommend people to try it out!
  • by kapad on 12/13/15, 12:35 AM

    I use fasd (https://github.com/clvv/fasd) and really like is fuzzy matching. Much better than autojump in my opinion.
  • by pi-rat on 12/12/15, 4:37 PM

    Use this all the time, it's awesome!
  • by dstroot on 12/12/15, 8:14 PM

    One of my all time favorites and used many, many times daily. Zsh and z = highly productive day.
  • by SeeThruHead on 12/12/15, 6:40 PM

    how is this news?
  • by NickHaflinger on 12/12/15, 5:11 PM

    'Tracks your most used directories, based on 'frecency'.'

    Shouldn't that be frequency ..

    https://github.com/rupa/z/blob/master/README