find

cli tree met find

find

find -maxdepth 2 -type d -ls | sed -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' > tree.txt

in tree text file
--test
----test.git
--apps
----namefile1.git
----namefile2.git

ls

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'

|-folder
|---dir
|---dir2

find with grep

grep -rnw '/path/to/somewhere/' -e 'pattern'

include

grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern"

exclude

grep --exclude=\*.o -rnw '/path/to/somewhere/' -e "pattern"

with dir

grep --exclude-dir={dir1,dir2,*.dst} -rnw '/path/to/somewhere/' -e "pattern"
Tags: 
Subscribe to RSS - find