Skip to content

Commit

Permalink
Add shell script: mlocate.fish.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgeron committed Jul 3, 2015
1 parent 95df753 commit d30736c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ http://snippets.bram.xyz/

Chrome/*

.. rubric:: Shell snippets

.. toctree::
:maxdepth: 2
:glob:

shell/*

.. rubric:: Birmingham computer science specific snippets

.. toctree::
Expand All @@ -20,6 +28,8 @@ http://snippets.bram.xyz/

SoCS/*



.. rubric:: Others' scripts and programs I like and fanboy about

* Ack_: like *grep* but with good defaults for programmers. Ignores version control and build directories; trivial to customise.
Expand Down
22 changes: 22 additions & 0 deletions shell/hlocate.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

************************************
hlocate.fish: find in home directory
************************************

``locate`` will not work if your home directory is encrypted. I use this instead::

function hlocate
find ~ | grep -e $argv[1] | sed "s|^$HOME|\~|"
end

Now::

bgeron@machine ~> hlocate test1234
~/tmp/test1234.txt
bgeron@machine ~>


This is a Fish_ script, but it should be easy to convert to bash syntax.


.. _Fish: http://fishshell.com/

0 comments on commit d30736c

Please sign in to comment.