Skip to main content

Program to provide a bash cd history directory stack

Project description

BASH SHELL CD HISTORY

cdhist is a utility which provides a bash shell cd history directory stack. A bash cd alias calls a python helper script to intercept your normal shell cd command and maintain a stack of directories you previously visited which can be listed and quickly jumped to by numeric index.

The latest version and documentation is available at http://github.com/bulletmark/cdhist.

USAGE

Add "somepath" to your directory stack and cd there:

cd somepath

List the current stack and its indices:

cd -l

Change dir to stack index "n":

cd -n

Search back through stack for "string" and cd there:

cd -/string

List the stack and its indices then immediately prompt for dir to select:

cd --

You can also type /string at the above prompt to search.

Show this help:

cd -h|?

All other arguments are passed on to the normal cd command.

INSTALLATION

Arch users can install cdhist from the AUR and skip to the next section.

Requires python-setuptools installed.

Requires bash + python 2.6 or later (and is compatible with python 3+). Note cdhist is on PyPI so you can sudo pip install cdhist or:

git clone http://github.com/bulletmark/cdhist
cd cdhist
sudo make uninstall # Do this to make sure old versions are purged
sudo make install

CONFIGURATION

Each user who wants to use the cdhist facility should source the /etc/cdhist.bashrc file into their bashrc, i.e in ~/.bashrc just add:

if [ -f /etc/cdhist.bashrc]; then
    source /etc/cdhist.bashrc
fi

Then log out and back in again.

ALTERNATIVE COMMAND NAME

Some people may prefer not to alias their system cd command to this utility and just use an alternative unique command name. To do this, set CDHISTCOMMAND to your preferred name before you invoke the cdhist.bashrc script in your ~/.bashrc. E.g, to use the command name xd rather than cd:

if [ -f /etc/cdhist.bashrc]; then
    export CDHISTCOMMAND=xd
    source /etc/cdhist.bashrc
fi

Then just type xd /tmp to change dir, xd -- to see and select dirs, etc.

UPGRADE

cd cdhist  # Source dir, as above
git pull
sudo make install

REMOVAL

cd cdhist  # Source dir, as above
sudo make uninstall

LICENSE

Copyright (C) 2010, 2012 Mark Blakeney. This program is distributed under the terms of the GNU General Public License. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at http://www.gnu.org/licenses/ for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdhist-1.5.4.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file cdhist-1.5.4.tar.gz.

File metadata

  • Download URL: cdhist-1.5.4.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for cdhist-1.5.4.tar.gz
Algorithm Hash digest
SHA256 4f105578f03e472fe4c70b6f30feebd00d1fbf0b958639ec63b5c342ded34603
MD5 9aac5f9f7a3d3a48b39badf163b2a723
BLAKE2b-256 d39603a73f4027616244106f9a28c7413938e8319f4aee2bedf843386f209f47

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page