negation in find path

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting negation in find path
# 1  
Old 01-16-2008
negation in find path


Pl suggest me how to ignore a path in find command... I am aware of using "!" for other option... but how can i use it like this exampl...

I want to search something for in / but not in [ /root and /etc ]

Pl help.

# 2  
Old 01-16-2008
Pls try this,
find / \( -type d -a \( -name root -o -name etc \) \) -prune -o -name '*.txt' -print

Nagarajan G
# 3  
Old 01-16-2008
Hi Nagarajan,

Its working..

Thank u very much..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Negation in Bash Globbing

$ ls -1 a.1 b.1 x_a.1 x_b.1 $ ls -1 * b.1 x_a.1 x_b.1 $ ls -1 ** a.1 b.1 x_a.1 x_b.1The last result is not as expected. Why? Thanks. (2 Replies)
Discussion started by: carloszhang
2 Replies

2. Linux

Find a string in a path

Hi All, I am trying to find a particular string in a path, but able to do so. I tried through grep command but its taking so long time which is not appropriate. e.g: Path : /oct/oracle/apps/OMEC/appl/xxaterp/1.0/reports/US/ Suppose in this path we have 10 .rdf file and I want to... (2 Replies)
Discussion started by: Vikash163
2 Replies

3. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

4. Homework & Coursework Questions


Hello, have anybody any idea, how to negate some expression? I have code that greps somethnig and I want filter from it some results...How to make it? IDontWantThisExpression=$1 grep 'some regex' | grep '$IDontWantThisExpression' testfile.txt Thanks for any advices. Faculty of... (2 Replies)
Discussion started by: Dworza
2 Replies

5. Shell Programming and Scripting

if statement negation

Hi all, I've been searching the internet and can't find an answer to this. Im trying to figure out how to negate a whole expression befor an if. I'll explain below. Let's say x=0 y=1 ] (this is false) I would like to negate this whole boolean condition. To negate the above... (4 Replies)
Discussion started by: rethymno19
4 Replies

6. Shell Programming and Scripting

How to find the path

Hi Iam new to this forum, could you pleae advise for below question iam send path as input before proceding i need to validate the path if it is exit or not if not it show path id not exist if the path is exits iam sending file name as input to search the file on the paricular... (5 Replies)
Discussion started by: saic
5 Replies

7. Shell Programming and Scripting

how to find the path of a file?

Hi all, Is there any way to find the the path of a file? I mean executable files and just anyother file we can think of? i know of one cmd called which $which mount /usr/bin/mount this is fine, but "mount" is a cmd not a file that can be searched eg: say i have created a text file... (3 Replies)
Discussion started by: wrapster
3 Replies

8. Shell Programming and Scripting

Bitwise negation

I am taking an online course on Unix scripting. The topic is Unix arithmetic operators and the lesson is Logical and bitwise operations. It is not clear how much storage space Unix uses to represent integers that are typed. Bitwise negation caused me to question how many bits are used to... (3 Replies)
Discussion started by: dLloydm
3 Replies

9. Solaris

Please help me find the PATH that I need to be on :)

I am learning UNIX through the School of Hard Knocks, I have very limited exposure to it. I managed to install Solaris 10 on my machine recently, and have downloaded and installed Sun Studio 11. When the installation of Sun Studio was complete, the GUI displayed the following: (Bourne shells)... (7 Replies)
Discussion started by: trmn8r
7 Replies
Login or Register to Ask a Question