# cd-recent

> A tool for listing and changing directory to a recently visited directory in a UNIX terminal

Latest version **1.1.5** (published 2018-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install cd-recent
pnpm add cd-recent
yarn add cd-recent
bun add cd-recent
```

Provides the command `cd-recent`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2018-06-22 |
| First published | 2018-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 392.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joshua Thomas Vernon |
| Maintainers | joshuatvernon |
| Keywords | cd-recent, cd, recent, unix, unix-command, terminal |

## Links

- npm: https://www.npmjs.com/package/cd-recent
- Repository: https://github.com/joshuatvernon/cd-recent
- Homepage: https://github.com/joshuatvernon/cd-recent#readme
- Issues: https://github.com/joshuatvernon/cd-recent/issues
- npm.io page: https://npm.io/package/cd-recent

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^6.0.1
- [commander](https://npm.io/package/commander.md) ^2.15.1
- [expand-tilde](https://npm.io/package/expand-tilde.md) ^2.0.2

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.1.5 (latest) — 2018-06-22
- 1.1.4 — 2018-06-22
- 1.1.3 — 2018-06-15
- 1.1.2 — 2018-06-15
- 1.1.1 — 2018-06-15
- 1.1.0 — 2018-06-10
- 1.0.6 — 2018-06-10
- 1.0.5 — 2018-06-10
- 1.0.4 — 2018-06-10
- 1.0.3 — 2018-06-10
- 1.0.2 — 2018-06-10
- 1.0.1 — 2018-06-10
- 1.0.0 — 2018-06-10
- 0.1.0 — 2018-06-09

## README

# 💿 cd-recent

> A CLI tool for listing recently visited directories in your UNIX terminal

![](./media/cd-recent-demo.gif)

## Installation

Install `cd-recent` globally to run anytime to find out what the most recent directories you've visited are:
```sh
$ npm i cd-recent -g
```

## Setup

`cd-recent` can be setup to either track recently visited directories dynamically (as you visit them) or retroactively by parsing your history file

_NOTE: parsing your history file retroactively will not produce absolute paths_

### Dynamic Tracking

To enable dynamic tracking of recently visited directories simply run:
```sh
$ cd-recent -t
```

Then override the `cd` builtin by adding the following to your `.bashrc` or `.zshrc`:
```sh
function cd() {
    builtin cd $1
    cd-recent -a $(pwd)
}
```

_NOTE: Dynamic tracking currently only stores a maximum of 1000 recently visited directories_

### Retroactively Tracking

Then easily set the full path to history file:
```sh
$ cd-recent -H [full-path-to-history-file]
```

## Running

List recently visited directories by running (valid directories will be displayed __green__):
```sh
$ cd-recent
```

List a specific number of recently visited directories by running:
```sh
$ cd-recent -l [limit]
```

Set a default number of recently visited directories to list by running:
```sh
$ cd-recent -d [default-limit]
```

Manually add to recently visited directories by running (dynamic tracking must be enabled):
```sh
$ cd-recent -a [full-path-of-directory]
```

Reset recently visit directories by running (dynamic tracking must be enabled):
```sh
$ cd-recent -r
```

## Help

Display the help menu by running:
```sh
$ cd-recent -h

Usage: cd-recent [options]

Options:

  -V, --version                                 output the version number
  -a --add [full path of directory]             adds a recently visited directory to list
  -d --defaultLimit [default limit]             sets default number of recent directories to list
  -H --historyFile [full path to history file]  sets history file to parse when tracking retroactively
  -l --limit [limit]                            sets limit of recent directories to list
  -r --reset                                    reset list of recently visited directories
  -t --toggle                                   toggle dynamic or retroactive recently visited directories tracking
  -h, --help                                    output usage information
```

## Contributing

Feel free to contribute by reporting issues, suggesting some new features or raising a pull request 🤘

---
_Source: https://npm.io/package/cd-recent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
