Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ ln -s path/to/a/really/deeply/nested/director/my-project ~/my-project
- $ cd ~/my-project
- MYPROJECT=path/to/a/really/deeply/nested/director/my-project
- $ cd $MYPROJECT
- # in file ~/.bashrc
- function work() {
- cd $HOME/path/to/a/really/deeply/nested/director/my-project
- }
- cd **/my-project
- CDPATH=/var/:/etc/
- alias myproject="cd path/to/a/really/deeply/nested/director/my-project"
- $ myproject
- # make the current directory the default anchor:
- $ anc s
- # go to /etc, then /, then /usr/local and then back to the default anchor:
- $ cd /etc; cd ..; cd usr/local; anc
- # go back to /usr/local :
- $ anc b
- # add another anchor:
- $ anc a $HOME/test
- # view the list of anchors (the default one has the asterisk):
- $ anc l
- (0) /path/to/first/anchor *
- (1) /home/usr/test
- # jump to the anchor we just added:
- # by using its anchor number
- $ anc 1
- # or by jumping to the last anchor in the list
- $ anc -1
- # add multiple anchors:
- $ anc a $HOME/projects/first $HOME/projects/second $HOME/documents/first
- # use text matching to jump to $HOME/projects/first
- $ anc pro fir
- # use text matching to jump to $HOME/documents/first
- $ anc doc fir
- # add anchor and jump to it using an absolute path
- $ anc /etc
- # is the same as
- $ anc a /etc; anc -1
- # add anchor and jump to it using a relative path
- $ anc ./X11 #note that "./" is required for relative paths
- # is the same as
- $ anc a X11; anc -1
- # using wildcards you can add many anchors at once
- $ anc a $HOME/projects/*
- # use shell completion to see a list of matching anchors
- # and select the one you want to jump to directly
- $ anc pro[TAB]
- pev add myDir /path/to/my/dir
- pev show
- | NAMES VALUES
- | ---------- ----------
- | pev_myDir "/path/to/my/dir"
- cd $pev_myDir
- # copy "file" from another path to the "myDir" directory
- cp /path/to/file $pev_myDir
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement