Directory bookmark in terminal

You are looking for a solution for quickly navigating to long paths in the shell (in particular, Max OS X Terminal.app).

Say my way ~ / This / Is / A / Really / Long / Path / That / I / Would / Rather / No / Type / Often

Instead of cd ~ / This / Is / A / ....

I would like to be able to store favorites / bookmark directories so that I can do "cd myPath"

Are there any files or tools available for this?

+3
source share
6 answers

I found Apparix 'and Goto ' packages that together create dreams for our addict terminals.

Naturally, I was unable to install Apparix, but I realized this at the end.

Apparix Mac OS X:

  • Apparix.
  • tarball, cd .
  • ./configure --prefix=$HOME/local && make && make install.
  • man apparix, BASH - , ( ---) ~/.bash_profile.

. Apparix OS X ( Apparix).

+8

Bashmarks,

$ cd ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently
$ s shortname # save current path as `shortname`
$ cd /          
$ g shortname # cd to ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently
+7

( ~/.bash_profile, , )

alias cd_bmark1='cd ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently'

cd_bmark1

+4

, , , , , .

  • , , CDPATH "cd". , cd, , CD ( , , bash zsh).

  • zsh bash . , , "dh" (: cd -3 3- ).

+1

?

ln -s ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently bmark
cd bmark
0

Source: https://habr.com/ru/post/1751693/


All Articles