Guest User

Untitled

a guest
Dec 16th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. # Travel To ...
  2.  
  3. ## --------------------- Installation ----------------------
  4.  
  5. You can either dump the contents of `travel.sh` into your `~/.bashrc` file, or save it somewhere else and source it.
  6. I keep mine in `/usr/local/bin` and at the bottom of `~/.bashrc` I have the line `source /usr/local/bin/travel.sh`.
  7. Then just restart your terminal session.
  8.  
  9. ## ------------------------ Usage -------------------------
  10.  
  11. Show help
  12. ```bash
  13. ~:$ tth
  14. ~:$ tt -h
  15. ~:$ tt --h
  16. ~:$ tt -help
  17. ~:$ tt --help
  18. ```
  19. ---
  20. Add a route
  21. ```bash
  22. ~:$ tta /var/www/html
  23. ~:$ tta /usr/local/bin ulb
  24. ```
  25. ---
  26. List available routes
  27. ```bash
  28. ~:$ ttl
  29. [html] = /var/www/html
  30. [ulb] = /usr/local/bin
  31.  
  32. ~:$ tta /var/log/apache2 logap
  33. ~:$ ttl
  34. [html] = /var/www/html
  35. [logap] = /var/log/apache2
  36. [ulb] = /usr/local/bin
  37. ```
  38. ---
  39. Rename a route
  40. ```bash
  41. ~:$ ttr html www
  42. ~:$ ttl
  43. [logap] = /var/log/apache2
  44. [ulb] = /usr/local/bin
  45. [www] = /var/www/html
  46. ```
  47. ---
  48. Delete one or more routes
  49. ```bash
  50. ~:$ ttd www logap
  51. ~:$ ttl
  52. [ulb] = /usr/local/bin
  53. ```
  54. ---
  55. Travel to a directory using an alias or path
  56. ```bash
  57. ~:$ tt ulb
  58. /usr/local/bin:$ tt /var/www
  59. /var/www:$ tt
  60. ~:$
  61. ```
  62. ---
  63. `tt` `ttd` and `ttr` support autocomplete
  64. ```bash
  65. ~:$ tt u<TAB>
  66. ~:$ tt ulb<TAB>
  67. ~:$ tt /usr/local/bin
  68.  
  69. ~:$ tta /usr/games ug
  70. ~:$ ttl
  71. [ulb] = /usr/local/bin
  72. [ug] = /usr/games
  73.  
  74. ~:$ tt u<TAB><TAB>
  75. ulb ug
  76. ~:$ tt u
  77. ```
Add Comment
Please, Sign In to add comment