grep usage - skipping dirs


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers grep usage - skipping dirs
# 1  
Old 01-04-2008
grep usage - skipping dirs

I am in Linux and would like to use the -d skip option for skipping directories in a grep search. What is the order of switches and strings?

switches I'd like to use: -irl -d skip '/dirtoskip'
text I am searching for: 'fax'
dir in which to begin: /var/www/kewbie/*

How should I join these together?

Thank you.
# 2  
Old 01-05-2008
You should have looked at the man page which would tell you quickly the order (Online Linux man page - grep)

grep [options] PATTERN [FILE...]
grep [options] [-e PATTERN | -f FILE] [FILE...]

command <--- Options -----> Pattern <---File--->
grep -irl -d skip '/dirtoskip' 'fax' /var/www/kewbie/*

(Note I don't have a linux system to test this Smilie )
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

**HELP** how to do a listing of dirs and all sub dirs only

I am trying to get a listing of ALL directories only under /export (as an example). I can get all the dirs directly under /export but I need any sub dirs under those dirs. I've looked (here and google) but can not find anything that works (4 Replies)
Discussion started by: bbraml
4 Replies

2. Homework & Coursework Questions

grep usage help?

Use and complete the template provided. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have to find all the files where the function sequentialInsert is called and the directory is ~cs252/Assignments/commandsAsst/project 2.... (2 Replies)
Discussion started by: jennkat
2 Replies

3. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

4. UNIX for Advanced & Expert Users

Grep usage

my file contains xxabced.p dlksfad; dflsdkjflkds flksdjflkdioewf erfsdlkfjsdla; dlkfjsd;lfkj msgdadf.p dslk kdjflksdjfl;asdfasdfjkljl fdsf;jd ppuskldf.p i want the output is xxabced.p msgdadf.p ppuskldf.p Can any one give the command? (1 Reply)
Discussion started by: kingganesh04
1 Replies

5. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

6. UNIX for Dummies Questions & Answers

Grep Usage

Hello, I am trying to use grep to locate multiple uses of the same word in the same line. The word has to be 3+ char, upper or lower or both. I tried this code <code> grep \({3,}\)*\1 i* </code> and i turned out zero results. Any ideas? ____________________________________________... (5 Replies)
Discussion started by: Omega1589
5 Replies

7. UNIX for Dummies Questions & Answers

Grep usage help

Hello, I have a list in .txt format of email addresses and I need to extract just a specific domain ... The list format is like: "123456";"user@domain.com";"email";"john";"name" "123457";"user2@domain.com";"email";"john";"name" "123458";"user3@domain.com";"email";"john";"name"... (7 Replies)
Discussion started by: holyearth
7 Replies

8. UNIX for Advanced & Expert Users

grep usage

grep can filter the text which want to display, but if I want it do not show the text specific in grep, how to do? thk a lot! (2 Replies)
Discussion started by: zp523444
2 Replies

9. UNIX for Dummies Questions & Answers

grep Vs CPU usage

Hi, I have one basic doubt, that using grep command frequently , will it have direct impact on the CPU load, pls clarify for eg, if i run a non stop script containing while loop to grep some parameters, what will be the load in CPU.. thanks (3 Replies)
Discussion started by: vasikaran
3 Replies

10. UNIX for Dummies Questions & Answers

using grep to find a value in current dir and sub dirs?

Hey guys, I would like to find all files which contain "client1.dat". I would like to search from the current directory and all subs and print out all the files that have this. Any help would be greatly appreciated. Thanks much. (10 Replies)
Discussion started by: ecupirate1998
10 Replies
Login or Register to Ask a Question