Search in Unix home directory

I have many views in my Linux home dir under different folders mentioned below.

Home

  1. CCVIEWS
  2. views
  3. Development
  4. testproject
    :
    :
    etc.

Now i want to list all the clearcase views in my linux dir in below format to work on other script.

1) user_test_Work1.vws
2) user_test_Work2.vws
3) user_dev_Work1.vws
4) user_newproject_Work.vws
5) user_cqfix.vws

How to search all the views in my home directory created by me and display the list of the views in shell script ?

Currently at a time i can display one folder views but i need to search and display all the views in the above format . iam using below commands to do the same.

cd ~/views 
ViewCount=`ls ~/views`

Any one pls help how to grep or search all views in multiple directories and list all these views .

To find the ".vws" files under all the directories in your home directory:

find . -name "*.vws" 

And count of it:

find . -name "*.vws"  | wc -l

If you want to find in particular directories ( For eg in CCVIEWS,views and Development, use:

find  CCVIEWS views Development -name "*.vws" 

Hi,

i don't want to mention all the dir names to search views

and more over i want to list all the views in below format

1) user_test_Work1.vws
2) user_test_Work2.vws
3) user_dev_Work1.vws
4) user_newproject_Work.vws
5) user_cqfix.vws

cmd :

find . -name "*.vws"  | wc -l 

this cmd giving just no of views . i want to display all the views as a list .pls suggest

Hi

find . -name "*.vws" | sed 's^.*/^^'

Guru.

it's working , thanks a lot :slight_smile: