사용자 도구

사이트 도구


linux:directory_navigation

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
linux:directory_navigation [2014/08/08 09:29]
kwon37xi
linux:directory_navigation [2014/08/28 14:47]
kwon37xi
줄 9: 줄 9:
 </code> </code>
  
 +===== Mark/Jump/Unmark =====
 +  * [[http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html|Quickly navigate your filesystem from the command-line - mark/unmark]]
 +  * ''vi ~/.bashrc''<code sh>
 +export MARKPATH=$HOME/.marks
 +function jump { 
 +    cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
 +}
 +function jopen { 
 +    thunar  "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
 +}
 +function mark { 
 +    mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
 +}
 +function unmark { 
 +    rm -i "$MARKPATH/$1"
 +}
 +function marks {
 +    ls -l "$MARKPATH" | sed 's/  / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
 +}
 +_completemarks() {
 +  local curw=${COMP_WORDS[COMP_CWORD]}
 +  local wordlist=$(find $MARKPATH -type l -printf "%f\n")
 +  COMPREPLY=($(compgen -W '${wordlist[@]}' -- "$curw"))
 +  return 0
 +}
 +
 +complete -F _completemarks jump unmark
 +</code>
 +  * usage<code sh>
 +cd ~/some/very/deep/often-used/directory
 +mark deep
 +
 +# This adds a symbolic link named deep to the directory ~/.marks. To jump to this directory, type the following from any place in the filesystem:
 +jump deep
 +
 +# To remove the bookmark (i.e., the symbolic link), type:
 +unmark deep
 +
 +# You can view all marks by typing:
 +marks
 +</code>
 ===== 기타 ===== ===== 기타 =====
   * https://github.com/clvv/fasd   * https://github.com/clvv/fasd
   * https://github.com/rupa/z   * https://github.com/rupa/z
-  * [[http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html|Quickly navigate your filesystem from the command-line - mark/unmark]] 
- 
linux/directory_navigation.txt · 마지막으로 수정됨: 2021/07/26 22:50 저자 kwon37xi