Filter results through pipe with grep


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Filter results through pipe with grep
# 1  
Old 07-10-2006
Filter results through pipe with grep

ls -ltr | grep string
How can I use regular expressions to filter the results provided even more. I am using the above command as a reference.
# 2  
Old 07-10-2006
either use 'grep' with the -'-E'
OR
use 'egrep' if you have one on your system
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Bash - CLI - grep - Passing result to grep through pipe

Hello. I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv" lsmod | (e)grep '^nv???????????? I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long ... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

How to launch results of a pipe?

Good afternoon, I have just messed up and deleted some directories on my UNIX machine. I would now want to know which packages are impacted by this. Therefore I have a look in the file "/var/sadm/install/contents" (which contains the filenames/directory names for each installation package). After... (2 Replies)
Discussion started by: scampsd
2 Replies

3. UNIX for Dummies Questions & Answers

Pipe binary file matches grep results to file

I am using grep to match a pattern, but the output is strange. $ grep -r -o "pattern" * Gives me: Binary file foo1 matches Binary file foo2 matches Binary file foo3 matches To find the lines before/after, I then have to use the following on each file: $ strings foo1 | grep -A1 -B1... (0 Replies)
Discussion started by: chipperuga
0 Replies

4. Shell Programming and Scripting

sed returns different results while substitution on a pipe delimited file

Hi, Need help with a sed command that I am using to substitute 3 positions of a pipe delimited file. i am getting different results while substituting the same position of two different files with the same value. Please see details below: $ cat chk2 ... (3 Replies)
Discussion started by: vmenon
3 Replies

5. Shell Programming and Scripting

Display find results, and pipe to xargs

I have an overnight script which runs across a large directory to repair permissions and ownership. I also have this command output the list of files affected so that cron can email these as a log file. Previously I had the command in the form: find /path/to/files -not -user myname -print -exec... (4 Replies)
Discussion started by: mij
4 Replies

6. Shell Programming and Scripting

How can I execute the results of a pipe?

Hello, I'm using csh. I have a file named "setup" that I normally source, e.g. source setupI'd like a one-liner that sources this file, but excluding lines that contain "DEBUG", e.g. cat setup | grep -v DEBUG | sourceOf course, the above does not work. How can I execute the results of a... (5 Replies)
Discussion started by: acheong87
5 Replies

7. Shell Programming and Scripting

Filter on a grep

I am attempting to figure out how to only capture part of a grep command I am doing. So far no luck. When I execute.... leviathan:/gfs/home/tivoli>ps -ef | /usr/ucb/ps -auxww | grep nco_p_syslog The results are.... tivoli 10185 0.0 0.0 5888 5168 ? S Oct 23 0:26... (2 Replies)
Discussion started by: LRoberts
2 Replies

8. UNIX for Dummies Questions & Answers

Pipe results of Grep Command to LS Comand

I'm using the command grep -l XYZ to get a list of files containing the string XYZ. Then I using the comand ls -l ABC to get the create date timestamp of the each file. I've tried combining the comands using the pipe command, grep -l XYZ | ls -l, but its not working. What am I doing wrong? (3 Replies)
Discussion started by: jhtate
3 Replies

9. UNIX for Dummies Questions & Answers

Pipe SQL select statement results to script

Hello I would like to perform a select from a oracle table and return those values to my shell script For example: site=head -1 $infile | cut -c1-15 | awk '{printf "s%", $0} sqlplus -s /nolog |& #Open pipe to sql select col1, col2, col3, col4 from oracle_table where col5 =... (6 Replies)
Discussion started by: houtakker
6 Replies

10. UNIX for Dummies Questions & Answers

What is the difference between pipe and filter?

Hi. I am bit confuse, you see i'm not to sure about the concept of pipe as used by Unix. How is pipe different from a filter? so, How is pipe different from a file redirection? Thanks, (3 Replies)
Discussion started by: mischiefdemon
3 Replies
Login or Register to Ask a Question