cd-recent
v1.1.5
Published
A tool for listing and changing directory to a recently visited directory in a UNIX terminal
Downloads
17
Maintainers
Readme
💿 cd-recent
A CLI tool for listing recently visited directories in your UNIX terminal
Installation
Install cd-recent
globally to run anytime to find out what the most recent directories you've visited are:
$ 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:
$ cd-recent -t
Then override the cd
builtin by adding the following to your .bashrc
or .zshrc
:
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:
$ cd-recent -H [full-path-to-history-file]
Running
List recently visited directories by running (valid directories will be displayed green):
$ cd-recent
List a specific number of recently visited directories by running:
$ cd-recent -l [limit]
Set a default number of recently visited directories to list by running:
$ cd-recent -d [default-limit]
Manually add to recently visited directories by running (dynamic tracking must be enabled):
$ cd-recent -a [full-path-of-directory]
Reset recently visit directories by running (dynamic tracking must be enabled):
$ cd-recent -r
Help
Display the help menu by running:
$ 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 🤘