# Print a filtered list histograms stored in a file via command line

**URL:** <https://root-forum.cern.ch/t/print-a-filtered-list-histograms-stored-in-a-file-via-command-line/33809>\
**Category:** Newbie\
**Created:** [April 29, 2019, 10:29am UTC](https://root-forum.cern.ch/t/print-a-filtered-list-histograms-stored-in-a-file-via-command-line/33809 "2019-04-29T10:29:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrey\_Pozdnyakov](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/andrey_pozdnyakov/32/12419_2.png) [@Andrey\_Pozdnyakov](https://root-forum.cern.ch/u/Andrey_Pozdnyakov)\
**Post date:** [April 29, 2019, 10:29am UTC](https://root-forum.cern.ch/t/print-a-filtered-list-histograms-stored-in-a-file-via-command-line/33809/1 "2019-04-29T10:29:10Z")

</div>

Hello,

I have a noobie question here:  
I would like a command like this to work:  
`[0] _file0->Print("myName_*")`  
or  
`[1] .ls("myName_*")`

That is to print only a subset of the histograms stored in a file, matching the name  
This works for TTrees (printing a subset of branches), so would be nice to do that with list of TH1s.

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [April 29, 2019, 10:53am UTC](https://root-forum.cern.ch/t/print-a-filtered-list-histograms-stored-in-a-file-via-command-line/33809/2 "2019-04-29T10:53:15Z")

</div>

Hi,

perhaps you can try a combination of `rootls` and `grep` at the command line.

Cheers,  
D
