How to use tree with grep and find to locate files by name?

How to use tree with grep and find to locate files by name?

How can I use tree and either grep or find in conjunction to find, for example, csv files using ".csv" as a file extension:

├── ./Videos
├── ./vscode
│   ├── ./vscode/foo.csv
│   ├── ./vscode/Hello.java
│   └── ./vscode/helloworld.ps1
└── ./xxxx

5850 directories, 29132 files
nicholas@mordor:~$ 
nicholas@mordor:~$ tree -f | grep *.csv
nicholas@mordor:~$ 

just for example. See also:

https://stackoverflow.com/q/10212192/4531180


looking for a specific file:

nicholas@mordor:~$ 
nicholas@mordor:~$ tree -f / | grep 'note.xml'
nicholas@mordor:~$ 

not quite sure where eXide put the file:

埃希德

also tried:

nicholas@mordor:~$ 
nicholas@mordor:~$ find /home/nicholas/ -name *note.xml*
nicholas@mordor:~$ 
nicholas@mordor:~$ find -iname "note.xml"
nicholas@mordor:~$ 

so bit perplexed.

答案1

Try using find instead.

find . -iname \*.csv

相关内容