Sponsored Content
Top Forums Shell Programming and Scripting Find: filename in every subdirectory matching a pattern Post 302937594 by wahi80 on Friday 6th of March 2015 12:02:37 PM
Old 03-06-2015
Find: filename in every subdirectory matching a pattern

Hi,

I have multiple directories built in following manner

Code:
/app/red/tmp
/app/blue/upd
/app/blue/tmp
/app/green/tmp
/app/red/upd
/app/green/upd

I have filenames having pattern ONE.XXX.dat TWO.ZZZ.dat and so on across the folders listed above

My objective is to list all filenames of a particular pattern in all upd sub-directories.

Currently I do it by writing individual commands like
Code:
find /app/blue/upd -type f -name "*ONE*"
find /app/red/upd -type f -name "*ONE*"
find /app/green/upd -type f -name "*ONE*"

Is there a way to combine above lines into one line?

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to find file name for non matching pattern

Hi, I want to list only the file names which do not contain a specific keyword or search string. OS: Solaris Also is there any way ; through the same script I can save the output of search to a CSV (comma seperated) so that the file can be used for inventory purpose. Any assistance will... (5 Replies)
Discussion started by: sujoy101
5 Replies

2. Shell Programming and Scripting

find and replace in subdirectory (filename & content - both)

Hi, I have to rename all occurance of CUST_MST to RESELLER_MST both in filename and file content under a directory (say D0) which contains multiple (2-3 levels) sub directory. Example: D0 -> D1 -> D2 has a file CUST_MST_TEMP.txt this contains : > cat /D0/D1/D2/CUST_MST_TEMP.txt... (3 Replies)
Discussion started by: sabyasm
3 Replies

3. Shell Programming and Scripting

Filename and Pattern matching

Hiiiii every one, I am facing a problem while giving a file name which has space in it. The problem is ... I have to read a file where the set of input files are stored. Now getting that name I have to open the file and i have to extract the name of the user from where it is written like"by... (2 Replies)
Discussion started by: kheyali Mitra
2 Replies

4. UNIX for Dummies Questions & Answers

Find files matching a pattern

Hi, I am writing a BASH shell script. I would like to count all the files in the CURRENT directory matching a specific pattern. Could someone suggest the best/simplest way to do this. I have thought of these solutions (for simplicity the pattern is all files starting with A): ls -1 *A | wc -l... (5 Replies)
Discussion started by: msb65
5 Replies

5. UNIX for Dummies Questions & Answers

find files NOT matching name pattern

Hi, I have following files in my directory: /TESTDONTDEL> ls -alt total 14 drwxr-xr-x 2 oracle dba 1024 May 15 06:30 . -rw-r--r-- 1 oracle dba 40 May 15 06:30 exception.txt -rw-r--r-- 1 oracle dba 19 May 15 06:22 ful_1234_test1.txt -rw-r--r-- 1... (2 Replies)
Discussion started by: sagarparadkar
2 Replies

6. UNIX for Dummies Questions & Answers

Pattern matching and Printing Filename

Hi, My requirement is to search for a paritcular string from a group of .gz files and to print the lines containing that string and the name of the files in which that string is present. Daily 500 odd .gz files will be generated in a directory(directory name will be in the form of... (4 Replies)
Discussion started by: krao
4 Replies

7. UNIX for Dummies Questions & Answers

Help with filename pattern matching

Hi, I have files in a directory with filenames that match three specific patterns: 1) *'.L2_LAC'* 2) *'.L2_LAC_OC'* 3) *'.L2_LAC_SST'* I would like to have an "ls" command that will list only files matching the first two patterns. However, if I type: ls *'.L2_LAC'* I will get files that... (2 Replies)
Discussion started by: msb65
2 Replies

8. UNIX for Dummies Questions & Answers

FIND matching pattern of lines in a file

I need to search for two patterns in a file and find number of matching lines. find . -type f | xargs grep "DROP TABLE" | wc -l find . -type f | xargs grep "DROP SYNONYM" | wc -l The above code works. However I am looking at finding a commnd that will simplify as on a singe command... (2 Replies)
Discussion started by: Siva SQL
2 Replies

9. UNIX for Dummies Questions & Answers

find Search - Find files not matching a pattern

Hello all, this is my first and probably not my last question around here. I do hope you can help or at least point me in the right direction. My question is as follows, I need to find files and possible folders which are not owner = AAA group = BBB with a said location and all sub folders ... (7 Replies)
Discussion started by: kilobyter
7 Replies

10. UNIX for Dummies Questions & Answers

Find pattern suffix matching pattern

Hi, I am trying to get a result out of this but fails please help. Have two files /tmp/1 & /tmp/hosts. /tmp/1 IP=123.456.789.01 WAS_HOSTNAME=abcdefgh.was.tb.dsdc /tmp/hosts 123.456.789.01 I want this result in /tmp/hosts if hostname is already there dont want duplicate entry. ... (5 Replies)
Discussion started by: rajeshwebspere
5 Replies
Gnome2::App(3pm)					User Contributed Perl Documentation					  Gnome2::App(3pm)

NAME
Gnome2::App - wrapper for GnomeApp HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::Container +----Gtk2::Bin +----Gtk2::Window +----Gnome2::App INTERFACES
Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable METHODS
widget = Gnome2::App->new ($appname, $title=undef) o $appname (string) o $title (string) scalar = $app->accel_group $app->add_dock_item ($item, $placement, $band_num, $band_position, $offset) o $item (Gnome2::Bonobo::DockItem) o $placement (Gnome2::Bonobo::DockPlacement) o $band_num (integer) o $band_position (integer) o $offset (integer) widget = $app->add_docked ($widget, $name, $behavior, $placement, $band_num, $band_position, $offset) o $widget (Gtk2::Widget) o $name (string) o $behavior (Gnome2::Bonobo::DockItemBehavior) o $placement (Gnome2::Bonobo::DockPlacement) o $band_num (integer) o $band_position (integer) o $offset (integer) $app->add_toolbar ($toolbar, $name, $behavior, $placement, $band_num, $band_position, $offset) o $toolbar (Gtk2::Toolbar) o $name (string) o $behavior (Gnome2::Bonobo::DockItemBehavior) o $placement (Gnome2::Bonobo::DockPlacement) o $band_num (integer) o $band_position (integer) o $offset (integer) scalar = $app->contents $app->set_contents ($contents) o $contents (Gtk2::Widget) $app->create_menus ($uiinfo) o $uiinfo (Gnome2::UIInfo) $app->create_toolbar ($uiinfo) o $uiinfo (Gnome2::UIInfo) scalar = $app->dock dock = $app->get_dock dockitem = $app->get_dock_item_by_name ($name) o $name (string) $app->enable_layout_config ($enable) o $enable (boolean) scalar = $app->get_enable_layout_config $app->insert_menus ($path, $menuinfo) o $path (string) o $menuinfo (Gnome2::UIInfo) $app->install_menu_hints ($uiinfo) o $uiinfo (Gnome2::UIInfo) scalar = $app->layout scalar = $app->menubar $app->set_menus ($menubar) o $menubar (Gtk2::MenuBar) scalar = $app->prefix $app->remove_menu_range ($path, $start, $items) o $path (string) o $start (integer) o $items (integer) $app->remove_menus ($path, $items) o $path (string) o $items (integer) Gnome2::App->setup_toolbar ($toolbar, $dock_item) o $toolbar (Gtk2::Toolbar) o $dock_item (Gnome2::Bonobo::DockItem) scalar = $app->statusbar $app->set_statusbar_custom ($container, $statusbar) o $container (Gtk2::Widget) o $statusbar (Gtk2::Widget) $app->set_statusbar ($statusbar) o $statusbar (Gtk2::Widget) $app->set_toolbar ($toolbar) o $toolbar (Gtk2::Toolbar) scalar = $app->vbox PROPERTIES
'app-id' (string : default undef : readable / writable / construct) The application ID string ENUMS AND FLAGS
flags Gnome2::Bonobo::DockItemBehavior o 'normal' / 'BONOBO_DOCK_ITEM_BEH_NORMAL' o 'exclusive' / 'BONOBO_DOCK_ITEM_BEH_EXCLUSIVE' o 'never-floating' / 'BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING' o 'never-vertical' / 'BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL' o 'never-horizontal' / 'BONOBO_DOCK_ITEM_BEH_NEVER_HORIZONTAL' o 'locked' / 'BONOBO_DOCK_ITEM_BEH_LOCKED' enum Gnome2::Bonobo::DockPlacement o 'top' / 'BONOBO_DOCK_TOP' o 'right' / 'BONOBO_DOCK_RIGHT' o 'bottom' / 'BONOBO_DOCK_BOTTOM' o 'left' / 'BONOBO_DOCK_LEFT' o 'floating' / 'BONOBO_DOCK_FLOATING' SEE ALSO
Gnome2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::Window COPYRIGHT
Copyright (C) 2003-2004 by the gtk2-perl team. This software is licensed under the LGPL. See Gnome2 for a full notice. perl v5.14.2 2011-11-16 Gnome2::App(3pm)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy