Skip to content

Commit

Permalink
new loc
Browse files Browse the repository at this point in the history
  • Loading branch information
eexpress committed Oct 31, 2014
1 parent ea0f972 commit 95319af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,6 +5,7 @@ cairo-weather
paste-img
nmn
mkd.*
lighttpd

adb
tags
Expand Down
2 changes: 1 addition & 1 deletion config/.bash_aliases
Expand Up @@ -82,7 +82,7 @@ nmap(){ /usr/bin/nmap ${1:-localhost}; }
p(){ ping -c 5 ${1:-www.163.com}; }
du(){ /usr/bin/du -sch "$@"|sort -rh; }
o(){ xdg-open ${1:-"`xsel -o|sed "s/\ /\\\ /g"|sed "s/\n.*//"`"}; }
loc(){ locate -eLin $(($LINES-4)) -r "^`pwd`.*$1[^\/]*$"; }
#loc(){ locate -eLin $(($LINES-4)) -r "^`pwd`.*$1[^\/]*$"; }
fcnt(){ n=`ls --color=none -1 $*|wc -l`; echo "一共有 "$n" 个文件。"; }
pkg-depend(){ [ -z $1 ] || aptitude search ~i~D"\b$1\b" -F %p|tr -d ' '|tr '\n' ';'|sed 's/;$/\n/'; }
#--------TAB COMPLETION ADD------------------------
Expand Down
4 changes: 4 additions & 0 deletions loc
@@ -0,0 +1,4 @@
#!/bin/bash

r=`echo $*|sed 's/\ /|/g'`
locate -AbeLi $*|grep "^`pwd`"|grep --color=always -iE "$r"

0 comments on commit 95319af

Please sign in to comment.