Sponsored Content
Top Forums Shell Programming and Scripting How to grep all the files inside the directory and Sub directory Post 302691125 by vidyadhar85 on Friday 24th of August 2012 01:31:47 AM
Old 08-24-2012
Dont you have -R option in Grep?
 

10 More Discussions You Might Find Interesting

1. Solaris

How to delete Directory and inside files using Find command

I am using the following Command to delete Directory with contents. But this command is deleting inside files only not directories. is there any change need in my command? find -type f -mtime +3 -exec rm -r {} \; Thanks (3 Replies)
Discussion started by: bmkreddy
3 Replies

2. UNIX for Advanced & Expert Users

How to see directory and the files inside it.

Hi Expert, How can i able to see the directory and the files inside the directories. Is it possible, please suggest. Thanks shaan (4 Replies)
Discussion started by: shaan_dmp
4 Replies

3. Shell Programming and Scripting

files of size 0 need to be deleted inside a directory

Hiiii, I have written a script which takes backup of some log files. let say the backuplocation is --- /abc/backuplocation -rw-r--r-- 1 webmut2 spgroup 0 Jan 27 02:41 ansrpt23994.log -rw-r--r-- 1 webmut2 spgroup 0 Jan 27 02:41 ansrpt3601.log -rw-r--r-- 1... (2 Replies)
Discussion started by: namishtiwari
2 Replies

4. UNIX for Dummies Questions & Answers

searching files inside directory

hey, i need to use grep to search a bunch of header files inside a directory to return which file i can find the function i'm searching for in. how do i use wild cards to search through the files? i can only figure out how to search inside the directory, not inside the files that are in the... (4 Replies)
Discussion started by: kylethesir
4 Replies

5. Shell Programming and Scripting

Find files inside the parent directory only

Hi All, The following find command lists the files which are 45 minutes older. But it searches for the sub directories also. $ find . -type f -mmin +45 -print ./hello.txt ./test/hi.txt ./temp/now.txt ls hello.txt test temp How can i modify the find command in such way that it finds... (4 Replies)
Discussion started by: Tuxidow
4 Replies

6. Shell Programming and Scripting

gzip files inside directory

Hello folks I hope every one is fine. I need to ask one question. I have directory /xx/abcd/data/ inside that data there are files like 11.txt 23.txt 12.txt *.txt i want that i will do compress each txt file inside that directory /xx/abcd/data/. But it will not gzip data... (1 Reply)
Discussion started by: learnbash
1 Replies

7. UNIX for Dummies Questions & Answers

Zip files inside the directory, but not the directory itself

Hi, Im facing a problem that im stucked, I have the following structure: thales@pereirtc-vbox:/home/VfARM$ ls code config doc lib manifest.bak manifest.rel manifest.v3 ns pub if i try to execute zip -q -o arm.zip VfARM/* it will create a zip file with the folder VfARM.... (2 Replies)
Discussion started by: Thales.Claro
2 Replies

8. Shell Programming and Scripting

remove a whole directory tree WITH files inside?

Assume I want to remove a whole directory tree beginning with /foo/bar/ The directory or sub-directories may contain files. The top directory /foo/bar/ itself should not be deleted. rm -f- r /foo/bar does not work because it requires a directory tree without files. How does it work... (3 Replies)
Discussion started by: pstein
3 Replies

9. Shell Programming and Scripting

Append string to all the files inside a directory excluding subdirectories and .zip files

Hii, Could someone help me to append string to the starting of all the filenames inside a directory but it should exclude .zip files and subdirectories. Eg. file1: test1.log file2: test2.log file3 test.zip After running the script file1: string_test1.log file2: string_test2.log file3:... (4 Replies)
Discussion started by: Ravi Kishore
4 Replies

10. Web Development

Apache2 does not display files inside directory

Hello, I have been running Ubuntu14.04 + apache2. 000-default.conf: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory... (5 Replies)
Discussion started by: baris35
5 Replies
POE::Filter::Stackable(3pm)				User Contributed Perl Documentation			       POE::Filter::Stackable(3pm)

NAME
POE::Filter::Stackable - combine multiple POE::Filter objects SYNOPSIS
#!perl use POE qw( Wheel::FollowTail Filter::Line Filter::Grep Filter::Stackable ); POE::Session->create( inline_states => { _start => sub { my $parse_input_as_lines = POE::Filter::Line->new(); my $select_sudo_log_lines = POE::Filter::Grep->new( Put => sub { 1 }, Get => sub { my $input = shift; return $input =~ /sudo[d+]/i; }, ); my $filter_stack = POE::Filter::Stackable->new( Filters => [ $parse_input_as_lines, # first on get, last on put $select_sudo_log_lines, # first on put, last on get ] ); $_[HEAP]{tailor} = POE::Wheel::FollowTail->new( Filename => "/var/log/system.log", InputEvent => "got_log_line", Filter => $filter_stack, ); }, got_log_line => sub { print "Log: $_[ARG0] "; } } ); POE::Kernel->run(); exit; DESCRIPTION
POE::Filter::Stackable combines multiple filters together in such a way that they appear to be a single filter. All the usual POE::Filter methods work, but data is secretly passed through the stacked filters before it is returned. POE::Wheel objects and stand-alone programs need no modifications to work with a filter stack. In the "SYNOPSIS", POE::Filter::Line and POE::Filter::Grep are combined into one filter that only returns a particular kind of line. This can be more efficient than filtering lines in application space, as fewer events may need to be dispatched and handled. Internally, filters are stored in an array. Data added by get_one_start() will flow through the filter array in increasing index order. Filter #0 will have first crack at it, followed by filter #1 and so. The get_one() call will return an item after it has passed through the last filter. put() passes data through the filters in descending index order. Data will go through the filter with the highest index first, and put() will return the results after data has passed through filter #0. PUBLIC FILTER METHODS
In addition to the usual POE::Filter methods, POE::Filter::Stackable also supports the following. new By default, new() creates an empty filter stack that behaves like POE::Filter::Stream. It may be given optional parameters to initialize the stack with an array of filters. my $sudo_lines = POE::Filter::Stackable->new( Filters => [ POE::Filter::Line->new(), POE::Filter::Grep->new( Put => sub { 1 }, # put all items Get => sub { shift() =~ /sudo[d+]/i }, ), ] ); pop Behaves like Perl's built-in pop() for the filter stack. The highest-indexed filter is removed from the stack and returned. Any data remaining in the filter's input buffer is lost, but an application may always call "get_pending" in POE::Filter on the returned filter. my $last_filter = $stackable->pop(); my $last_buffer = $last_filter->get_pending(); shift Behaves like Perl's built-in shift() for the filter stack. The 0th filter is removed from the stack and returned. Any data remaining in the filter's input buffer is passed to the new head of the stack, or it is lost if the stack becomes empty. An application may also call "get_pending" in POE::Filter on the returned filter to examine the filter's input buffer. my $first_filter = $stackable->shift(); my $first_buffer = $first_filter->get_pending(); push FILTER[, FILTER] push() adds one or more new FILTERs to the end of the stack. The newly pushed FILTERs will process input last, and they will handle output first. # Reverse data read through the stack. # rot13 encode data sent through the stack. $stackable->push( POE::Filter::Map->( Get => sub { return scalar reverse shift() }, Put => sub { local $_ = shift(); tr[a-zA-Z][n-za-mN-ZA-M]; $_ }, ) ); unshift FILTER[, FILTER] unshift() adds one or more new FILTERs to the beginning of the stack. The newly unshifted FILTERs will process input first, and they will handle output last. filters filters() returns a list of the filters inside the Stackable filter, in the stack's native order. Calling "<$filter_stack-"filters()>> in the "SYNOPSIS" would return a list of two filter objects: POE::Filter::Line=ARRAY(0x8b5ee0) POE::Filter::Grep=ARRAY(0x8b5f7c) filter_types filter_types() returns a list of class names for each filter in the stack, in the stack's native order. Calling "<$filter_stack-"filter_types()>> in the "SYNOPSIS" would return a list of two class names: POE::FIlter::Line POE::Filter::Grep It could easily be replaced by: my @filter_types = map { ref } $filter_stack->filters; SEE ALSO
POE::Filter for more information about filters in general. Specific filters, amongst which are: POE::Filter::Block, POE::Filter::Grep, POE::Filter::HTTPD, POE::Filter::Line, POE::Filter::Map, POE::Filter::RecordBlock, POE::Filter::Reference, POE::Filter::Stream BUGS
None currently known. AUTHORS &; COPYRIGHTS The Stackable filter was contributed by Dieter Pearcey. Documentation provided by Rocco Caputo. Please see the POE manpage for more information about authors and contributors. perl v5.14.2 2012-05-15 POE::Filter::Stackable(3pm)
All times are GMT -4. The time now is 04:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy