A bad version of the unix-like tree command and a visual version of find command that shows the results found in a visual tree
Go to file
Amber 98f55a65f0 README.md 2024-04-08 10:20:44 +02:00
src vfind, supporting shell expansions and regexp 2024-04-05 14:22:11 +02:00
.gitignore supporting regexp 2024-02-01 16:31:38 +01:00
LICENSE Initial commit 2024-01-15 09:04:53 +01:00
README.md README.md 2024-04-08 10:20:44 +02:00
ntree.py ntree colors 2024-03-28 16:11:35 +01:00
vfind.py vfind, supporting shell expansions and regexp 2024-04-05 14:22:11 +02:00

README.md

Visual Find

vfind is a tool written in python based on nerd_tree.
Its purpose (and base idea) is to blend the unix command find with the tree command.
You can search in a particular subtree for files or folders that match a regular expression and other criteria, the results will be shown graphically in a tree (in a similar way that the tree command does).

Installation on your system

In my opinion the better solution is:

  1. Clone the repository in your home folder
  2. Go to your home folder and make a symbolic link to the command in your ~/bin folder
  cd ~/nerd_tree
  ln -s ~/nerd_tree/vfind.py ~/bin/vfind

How to use

vfind has 2 mandatory arguments, the path of subtree from which to begin the search and the search pattern. The search pattern can be:

  • an expression whith wild card supporting the shell expansion, the default
  • a regular expression, using the flag -re

The only thing that needs to be remembered is to wrap in double quote the regular expression in conjunction with the -re flag when you choose to use it, for example:

vfind ~/nerd_tree/ -re "(.*)rem(.*)"

all items matching the pattern are show in the result tree: in this specific case any name containing rem substring
The same results above can be achieved using the command version with the shell expansion:

vfind ~/nerd_tree/ *rem*

You can use as pattern any valid regular expression, for example pattern as this

vfind ~/nerd_tree/ -re "(.*)rem|tree(.*)"

The folder matching the pattern are show collapsed with information about the total number of files and the size of the subtree. If you want to show the subtree expanded you can use the flag -s

vfind ~/nerd_tree/ -re "(.*)rem(.*)" -s

Include/Exclude path

You can include a set of results selecting specific branch (or paths) with the option -i (include). For example:

vfind ~/nerd_tree/ -re "(.*)py" -i src

include the results that along the path have the name src.
NOTE the command above is equivalent to

vfind ~/nerd_tree/ *py -i src             

You can include the -i more than once, for example:

vfind ~/nerd_tree/ "([0-9][0-9])|(^tree_(.*))" -i src -i .git

the above command will search for files or folders with a two digits name or with the name beginning with tree_ only in the path src or .git

In a similar manner you can exclude paths with the option -e, too in this case you can specify more than once the option -e

vfind ~/nerd_tree/ "(.*)py" -e src