Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. $ ln -s path/to/a/really/deeply/nested/director/my-project ~/my-project
  2.  
  3. $ cd ~/my-project
  4.  
  5. MYPROJECT=path/to/a/really/deeply/nested/director/my-project
  6.  
  7. $ cd $MYPROJECT
  8.  
  9. # in file ~/.bashrc
  10. function work() {
  11. cd $HOME/path/to/a/really/deeply/nested/director/my-project
  12. }
  13.  
  14. cd **/my-project
  15.  
  16. CDPATH=/var/:/etc/
  17.  
  18. alias myproject="cd path/to/a/really/deeply/nested/director/my-project"
  19.  
  20. $ myproject
  21.  
  22. # make the current directory the default anchor:
  23. $ anc s
  24.  
  25. # go to /etc, then /, then /usr/local and then back to the default anchor:
  26. $ cd /etc; cd ..; cd usr/local; anc
  27.  
  28. # go back to /usr/local :
  29. $ anc b
  30.  
  31. # add another anchor:
  32. $ anc a $HOME/test
  33.  
  34. # view the list of anchors (the default one has the asterisk):
  35. $ anc l
  36. (0) /path/to/first/anchor *
  37. (1) /home/usr/test
  38.  
  39. # jump to the anchor we just added:
  40. # by using its anchor number
  41. $ anc 1
  42. # or by jumping to the last anchor in the list
  43. $ anc -1
  44.  
  45. # add multiple anchors:
  46. $ anc a $HOME/projects/first $HOME/projects/second $HOME/documents/first
  47.  
  48. # use text matching to jump to $HOME/projects/first
  49. $ anc pro fir
  50.  
  51. # use text matching to jump to $HOME/documents/first
  52. $ anc doc fir
  53.  
  54. # add anchor and jump to it using an absolute path
  55. $ anc /etc
  56. # is the same as
  57. $ anc a /etc; anc -1
  58.  
  59. # add anchor and jump to it using a relative path
  60. $ anc ./X11 #note that "./" is required for relative paths
  61. # is the same as
  62. $ anc a X11; anc -1
  63.  
  64. # using wildcards you can add many anchors at once
  65. $ anc a $HOME/projects/*
  66.  
  67. # use shell completion to see a list of matching anchors
  68. # and select the one you want to jump to directly
  69. $ anc pro[TAB]
  70.  
  71. pev add myDir /path/to/my/dir
  72.  
  73. pev show
  74.  
  75. | NAMES VALUES
  76. | ---------- ----------
  77. | pev_myDir "/path/to/my/dir"
  78.  
  79. cd $pev_myDir
  80.  
  81. # copy "file" from another path to the "myDir" directory
  82. cp /path/to/file $pev_myDir
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement