Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How would I efficiently go about searching for .png | .svg | .xpm image-files in a complex and recursively structured hierarchy in one query, using terminal (and if possible | (pipe) tree in the same query, to get a nice output/overview, like in the example below:

├── arrows
│   ├── submenu01.png
│   └── submenu02.png
├── awesome
   ├── 01
   │   ├── ac.png
   │   ├── awesome.png
   │   ├── bat_low.png
   │   ├── bat_no.png
   │   │   ├── close_normal_all.png
   │   │   ├── floating_focus_inactive.png
   │   │   ├── floating_normal_active.png
   │   ├── vol_low.png
   │   ├── vol_mute.png
   │   ├── vol_no.png
   │   ├── vol_up.png
   │   └── widget_bg.png
   ├── antilight_by_sunjack94-d3ddff6.tar
   ├── As_It_Fades_by_synorgy.png


I'd like to do this in:

/usr/share/

Any help is highly appreciated, even if it doesn't fully fit my request!

share|improve this question

1 Answer 1

up vote 10 down vote accepted

Install the package tree than use

tree -P '*.png|*.svg|*.xpm' --prune /usr/share/
share|improve this answer
    
I am getting "tree: Invalid argument --'." when using --prune`. and I did not found this option in man pages. Would you plz put some light :) –  souravc Feb 24 at 19:24
    
Copy and paste the command. –  wojox Feb 24 at 19:30
2  
Sorry. --prune needs at least Ubuntu 12.10 –  Florian Diesch Feb 24 at 19:33
2  
(Or you could just pull tree back from a later release) –  Oli Feb 24 at 21:13
    
Thank you Florian for your answer and sorry for the late reply. Is there any alternative to prune you know of for 11.10 that i could use?! I'll try Olis' suggestion and if that doesn't work I'll wait a few days before I accept your answer. +1 –  v2r Feb 25 at 17:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.