The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Find and edit files simultaneously

Contributed by: Mikael Jansson
This tip is valid for: Both BeOS and Haiku

BeOS queries can make your life easier in ways you might not expect. This method uses queries to allow you to find and launch any file quickly, regardless the current directory. For example, if you’re sitting in a Terminal at /boot/home and want to edit a file living in /boot/home/projects/reports/March/daily… you don’t have to cd to that location or enter the whole path.

To make this work, add this to your .profile:

function qed {
/boot/apps/Eddie/Eddie $(query name=$*|tr "
" " ") &
}

Substitute the path to Eddie above with the path to Pe, StyledEdit, or whatever your favorite editor is. Now, if you want to edit a file called “frop” living anywhere on your hard drive, all you have to do is type:

qed frop

Note that this technique does require you to know the exact filename, and doesn’t deal well when paths to files have spaces in them.

Posted in Terminal


(comments are closed).