Skip to content

Provide a quick way to change directory from the command line

Notifications You must be signed in to change notification settings

chen1706/mark-directory

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

INTRO

Provides a quick way to change directory from the command line.

It's so small that everyone can understand it and then customize for yourself.

It's an improved version of which originally written by @jeroen janssens. @jeroen janssens has posted an article "Quickly navigate your filesystem from the command-line" to introduce this smart tool.

The improved points:

  • Provides a simple install/uninstall script;
  • Only complete the first argument for jump or unmark;
  • Make the marks command work on both GNU Linux and MAC OSX;
  • More hint when error occured, redirect error message to stderr;
  • When run mark command, set default mark name to directory basename;
  • Make jump command more smarter, just like cd;

Usage

First install from github:

$ git clone https://github.com/dangoakachan/mark-directory
$ cd mark-directory
$ sh install_markrc.sh
$ source ~/.markrc

Then play it with following commands:

$ cd /your/favorite/direcotry
$ mark a-name-you-like # make a mark
$ cd
$ jump a-name-you-like # jump to the marked directory based on the name
$ marks                # list the predefined marks
$ unmark a-name-you-like # unmake the name

The jump command, which I've add an alias named j for, is very smarter:

$ jump           # like `cd`, jump to your home
$ jump -         # like `cd -`, jump to last visited directory
$ jump $dir      # uh... just jump to the directory directly
$ jump ~kodango  # same as above, ~kodango will be expanded to kodango's home directory
$ jump markname  # jump to the corresponding marked directory

That's all!

About

Provide a quick way to change directory from the command line

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published