ret: A tool that returns to a landmark parent directory

[ mit, program, tool ] [ Propose Tags ]

A tool that outputs a parent directory with a landmark

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS],,,,
Dependencies base (>=4.15 && <5), case-insensitive (>=1.2), containers (>=0.6), directory (>=1.3), filepath (>=1.4), unix (>=2.7) [details]
License MIT
Copyright ⓒ 2023 Anselm Schüler
Author Anselm Schüler
Category Tool
Home page
Bug tracker
Source repo this: git clone v0.2.0.0)
head: git clone -b b0
Uploaded by anselmschueler at 2023-01-26T16:44:56Z
Distributions NixOS:
Executables ret
Downloads 92 total (21 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2023-01-26 [all 1 reports]

Readme for ret-

[back to package description]


Ret is a tool that goes up the directory chain and returns the first directory with a landmark.

A landmark is an important property of the directory, such as the existence of a configuration file, being the user’s home directory, or being on a different drive.

This project is hosted on GitHub.
This project is on Hackage.

How to use

You can use this to go back to your project root in a jiffy by using your shell’s command substitution syntax, e.g.:

cd $(ret)


cd (ret)

You can specify a set of landmark names as the arguments to ret to only use them. You can also specify a set of default landmark names in $XDG_CONFIG_HOME/ret/landmarks.txt, one per line.

You are invited to contribute more landmark specifications! Look in the source code, it’s easy.

Shell integration

After installing (see below), you can make using ret even more convenient by defining a shell function that does cd for you.


ret() {
  cd $(command ret $@)


function ret
  cd (command ret $argv)


This project is hosted on Hackage. You can install it via:

cabal install ret

This project is also redistributed for Nix in Nixpkgs under haskellPackages.ret.


Clone the repository and run this in it:

cabal build