You basically enter a search term or regex and it will search recursively down from your current directory to find the file. If >1 results are found it displays a navigable list of files to open, otherwise it immediately loads the file in your $EDITOR (or defaults to vim).
It also can search file contents in addition to a path regex, with all the same functionality to browse and open files.
OP's script looks neat. I think there are all sorts of things we could do to improve cmdline usability.
I've been burned by these kind of tools before, when I started using the CDPATH variable, as supported by bash.
Imagine the situation where you have a bunch of domains stored beneath /home/www. For example "/home/www/example.com" and "/home/www/example.org". (This is common for vhosts with a single prefix).
I decided I was going to get rid of the archived copies beneath /var/backup - so I decide to run "cd /var/backup; cd example.com; rm -rf *". Because of the path-searching I ended up at my live location, not my (obsolete) backup.
Since then I've always decided to navigate manually.
Shameless plug: I wrote a similar utility for myself called 'Goto Bookmark' which allows you to bookmark a directory so you can jump to it from anywhere when needed.
A very, very simple cd "hack" I use is (put this in your .bashrc):
function cd()
{
builtin cd "$*" && ls
}
it automatically runs "ls" every time you cd somewhere. I find when I'm using someone elses box or SSH'd in somewhere it's really annoying not to have it.
[+] [-] pajju|13 years ago|reply
https://github.com/clvv/fasd
+ Fasd (pronounced similar to "fast") is a command-line productivity booster.
+ Fasd offers quick access to files and directories for POSIX shells. It is inspired by tools like autojump, z and v.
+ Fasd keeps track of files and directories you have accessed, so that you can quickly reference them in the command line.
I've been using this tool, nothing comes close this one. Trust me on this. :)
[+] [-] pekk|13 years ago|reply
[+] [-] toisanji|13 years ago|reply
[+] [-] tuananh|13 years ago|reply
[+] [-] cpa|13 years ago|reply
$ cd foo1
$ pushd ~/foo2
[do some work]
$ pushd ~/foo3
[do some work]
$ popd
$ pwd
~/foo2
$ popd
$ pwd
~/foo1
[+] [-] cpeterso|13 years ago|reply
I also alias .. to 'cd ..' and ... to 'cd ../..' (and so on).
[+] [-] izakage|13 years ago|reply
[+] [-] SoftwareMaven|13 years ago|reply
[+] [-] lobster_johnson|13 years ago|reply
https://github.com/rupa/z
[+] [-] manojlds|13 years ago|reply
Also, an implementation of CDPATH - https://github.com/manojlds/cdposh
[+] [-] mtrn|13 years ago|reply
[+] [-] logn|13 years ago|reply
https://github.com/hollingsworthd/POSIXplorer
You basically enter a search term or regex and it will search recursively down from your current directory to find the file. If >1 results are found it displays a navigable list of files to open, otherwise it immediately loads the file in your $EDITOR (or defaults to vim).
It also can search file contents in addition to a path regex, with all the same functionality to browse and open files.
OP's script looks neat. I think there are all sorts of things we could do to improve cmdline usability.
[+] [-] stevekemp|13 years ago|reply
Imagine the situation where you have a bunch of domains stored beneath /home/www. For example "/home/www/example.com" and "/home/www/example.org". (This is common for vhosts with a single prefix).
I decided I was going to get rid of the archived copies beneath /var/backup - so I decide to run "cd /var/backup; cd example.com; rm -rf *". Because of the path-searching I ended up at my live location, not my (obsolete) backup.
Since then I've always decided to navigate manually.
[+] [-] amarsahinovic|13 years ago|reply
Bitbucket: https://bitbucket.org/amarsahinovic/gb
Github mirror: https://github.com/amarsahinovic/gb
[+] [-] JesseAldridge|13 years ago|reply
One nice feature is you can jump to the nth matching result like so:
[+] [-] nviennot|13 years ago|reply
ctrl+f is similar to "forward" in your browser. ctrl+b is similar to "back" in your browser.
[+] [-] jgross206|13 years ago|reply
function cd() { builtin cd "$*" && ls }
it automatically runs "ls" every time you cd somewhere. I find when I'm using someone elses box or SSH'd in somewhere it's really annoying not to have it.
[+] [-] Splognosticus|13 years ago|reply
http://www.gnu.org/software/bash/manual/bashref.html#Searchi...
[+] [-] tkellogg|13 years ago|reply
https://github.com/tkellogg/Jump-Location
[+] [-] meonkeys|13 years ago|reply
[+] [-] DanielRibeiro|13 years ago|reply
[+] [-] hk__2|13 years ago|reply
[+] [-] daemon13|13 years ago|reply
[+] [-] crazydiamond|13 years ago|reply