Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/bash-cdstack
Store the last X directories visited using cd in bash
https://github.com/bahamas10/bash-cdstack
Last synced: about 2 months ago
JSON representation
Store the last X directories visited using cd in bash
- Host: GitHub
- URL: https://github.com/bahamas10/bash-cdstack
- Owner: bahamas10
- Created: 2013-09-25T05:30:48.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-11-21T08:24:32.000Z (about 5 years ago)
- Last Synced: 2024-05-08T20:01:56.331Z (8 months ago)
- Language: Shell
- Homepage: http://daveeddy.com/2013/09/14/directory-management-with-cd/
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
bash-cdstack
============Store the last X directories visited using `cd` in bash
See the blog post here: http://daveeddy.com/2013/09/14/directory-management-with-cd/
![cdstack](http://daveeddy.com/static/media/2013/09/cdstack.png)
Installation
------------### bics
Use [bics](https://github.com/bahamas10/bics) to manage this plugin
After installing `bics`, install this plugin by running
bics install git://github.com/bahamas10/bash-cdstack.git
### manually
git clone git://github.com/bahamas10/bash-cdstack.git
cd bash-cdstack
cat cdstack.bash >> ~/.bashrc
exec bashUsage
-----You `cd` around like you normally would, and the directories are pushed into a
stack. Use the function `s` to view the stack of directories, and run `s "$num"` to
`cd` into the directory listed. Use `b` to jump back 1 directory.Exports
-------### Global Variables
- `CD_STACK_MAX` - the max number of directory names to store, defaults to 15
- `CD_STACK_REVERSE` - set this variable to an non-zero length string to reverse the stack when printed with `s`
- `_CD_STACK` - (private) the stack object itself (an array)
- `_CD_STACK_PTR` - (private) the current position in the stack### Environmental Variables
None
### Functions
- `cd()` - `cd` as you would expect it, but it records directories into the stack
- `s()` - show the current directory stack, or pass an argument to move into a stacked dir
- `b()` - jump back 1 directory in the stack### Aliases
None
License
-------MIT