SD — switch directory using a dynamic stack
SD is a directory navigation utility for ksh93u+, bash ≥ 4.2, and zsh ≥ 4.3, using frequency–recency tracking over an explicit visit history. Ksh-compatibility options are enabled: extglob in bash; KSH_ARRAYS , KSH_GLOB , POSIX_BUILTINS , and SH_WORD_SPLIT in zsh.
Note: This project is unrelated to the Rust-based sd text replacement tool.
This repository is a read-only snapshot mirror containing tagged stable states.
Issues are monitored, and pull requests may be considered for manual integration.
Overview
SD provides the sd command, designed to act as a drop-in replacement for cd for pathname arguments. In addition, it supports pattern-based directory selection from a dynamically ranked directory stack.
Directory ranking is computed over a trailing window of recorded directory visits. For each directory, a score is obtained by summing weighted contributions of its visits within that window. The weighting follows a configurable power-law kernel over normalized event indices.
Repeated invocation with the same pattern cycles deterministically through successive rank-ordered matches.
The companion command ds exposes the ranked directory stack and provides inspection and management functions.
... continue reading