grep

List all files in all subdirectories NOT having specified file permissions

I need to see all files (with full pathname), along with their file permissions, on a folder which DO NOT match -rw-r--r-- This didn't work as I thought it should have: #ls -laR | grep --invert-match '-rw-r--r--' grep: invalid option -- - ...

In-place processing with grep

I've got a script that calls grep to process a text file. Currently I am doing something like this. $ grep 'SomeRegEx' myfile.txt > myfile.txt.temp $ mv myfile.txt.temp myfile.txt I'm wondering if there is any way to do in-place processing, as in store the results to the same original file without having to create a temporary file and...

grep commad is not working properly

I am trying to extract the value from in File.txt : 116206K->13056K(118080K), 0.0879950 secs][Tenured:274796K->68056K(274892K), 0.2713740 secs] 377579K->68056K(392972K), [Perm :17698K->17604K(17920K)], 0.3604630 secs] I have try to extract cat File.txt | grep 'Perm '| cut -d',' -f3|cut -d'(' -f2 |cut -d')' -f 1 What ...

egrep regex not working on regex that works in other program.

I have this working regex (tested on regex coach): \n[\s]*[0-9]*[\s]*[0-9]*(\.)?[0-9]*(e\+)?[0-9]* that is supposed to pick up the first 2 columns of this file http://wwwhomes.uni-bielefeld.de/achim/highly.txt I read through the man pages, and it says that ^ will match at the beggining of the line so I replaced \n with ^ but egrep i...

Passing output from one command as argument to another

Hello, I have this for: for i in `ls -1 access.log*`; do tail $i |awk {'print $4'} |cut -d: -f 1 |grep - $i > $i.output; done ls will give access.log, access.log.1, access.log.2 etc. tail will give me the last line of each file, which looks like: 192.168.1.23 - - [08/Oct/2010:14:05:04 +0300] etc. etc. etc awk+cut will extract the dat...

Passing a file with multiple patterns to grep

Let's say we have two files. match.txt: A file containing patterns to match: fed ghi tsr qpo data.txt: A file containing lines of text: abc fed ghi jkl mno pqr stu vwx zyx wvu tsr qpo Now, I want to issue a grep command that should return the first and third line from data.txt: abc fed ghi jkl zyx wvu tsr qpo ... because each o...