close

bookmark

Github 上總是有許多有用或有趣的專案,
例如這個前幾天同事分享的 bashmarks
雖然我們可以自己在終端機的介面上用 symbol link 的方式建立連結,
但下 ln -s xxxxx 這樣的指令總是比較麻煩,
而且這些連結也分散在各個目錄。

而 bashmarks 的專案,
剛好解決了想在終端機內快速切換路徑的需求。

整個安裝步驟很簡單,
只要 

  1. git clone git://github.com/huyng/bashmarks.git
  2. cd bashmarks && make install
  3. add source ~/.local/bin/bashmarks.sh from within your ~.bash_profile or ~/.bashrc file

就安裝好這個 bashmarks 了

s <bookmark_name> - Saves the current directory as "bookmark_name" 
g <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name"
p <bookmark_name> - Prints the directory associated with "bookmark_name"
d <bookmark_name> - Deletes the bookmark
l - Lists all available bookmarks

然後在要儲存的路徑下,
打入 s 我們自取的名稱就可以儲存這個路徑
之後在任何一個地方打 g 路徑名稱就可以直接切換過去。
當然也可以打 l 看現在有哪些路徑的 bookmarks

有興趣瞭解更多的朋友可以到 https://github.com/huyng/bashmarks 去看看 這個 script 是怎麼寫的 :) 

Technorati Tags: github, bookmark, bashmarks, shell

arrow
arrow
    全站熱搜

    賽拉維‧柯南 發表在 痞客邦 留言(0) 人氣()