LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-06-2003, 01:56 AM   #1
rytrom
LQ Newbie
 
Registered: Jul 2003
Posts: 27

Rep: Reputation: 15
Question on find command


There is a directory with other subdirs. In some of them there is ABC directory. I need to find all read-only files but not whose parent directory is ABC (so searching recursivly bun not under ABC). With read-only case I have no problem but how to denote the last fact in find command?

find -perm ugo=r -o {parent dir is not ABC}
 
Old 08-06-2003, 11:28 AM   #2
arobic
Member
 
Registered: Jul 2003
Location: Geneva, Switzerland
Distribution: Debian 3.1, SLC3 (based on RHEL)
Posts: 84

Rep: Reputation: 15
I don't think you can actually ask for this in find.

But I would rather use -path */*/<an general expression which avoid ABC> if it is possible.
Hope this helps!

Cheers
Andree
 
Old 08-06-2003, 05:19 PM   #3
rytrom
LQ Newbie
 
Registered: Jul 2003
Posts: 27

Original Poster
Rep: Reputation: 15
Yea, it helped but not 100%:-) I'm not a guru in regular expressions that find accepts and vi's ones are not appliable fully in the case.

How can I specify a path that doesn't contain directory ABC? How operator NOT works here? Do I understand right that the pattern in -path clause is applied to the full path of a file as if it were printed by ls command? If so how should I create a pattern to describe occurence of a word ABC in any place of file full path ?

Let's for example assume I have in my current dir the following structure:

.
./a.txt
./b.txt
./ABC/c.txt
/ABC/ABC/d.txt
/otherdir/f.txt


I need only a, b and f files.


Thanks in advance
 
Old 08-07-2003, 02:14 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,605

Rep: Reputation: Disabled
Try

find -perm ugo=r -o | grep -v ABC

I can't test it here, in the office we use WinNT.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find/grep command to find matching files, print filename, then print matching content stefanlasiewski Programming 9 06-30-2016 05:30 PM
The find command Gins Linux - General 32 06-12-2005 02:20 PM
question on "find" command jcosenzo Linux - General 1 04-18-2005 02:39 PM
find command palmmjsg23 Linux - General 9 01-30-2004 10:45 PM
Find Command - Basic Question tlb04 Linux - General 3 05-06-2003 08:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration