- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: find -perm
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 03:43 AM
тАО07-11-2006 03:43 AM
find -perm
I tried:
find . -perm -u=r -exec ll -d {} \;
but that returned files with rw-rw---- also.
Any idea how to limit the find to just finding files with read only permissions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 03:49 AM
тАО07-11-2006 03:49 AM
Re: find -perm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 03:51 AM
тАО07-11-2006 03:51 AM
Re: find -perm
find ./ -perm u=r -exec ll -d {}\;
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 03:52 AM
тАО07-11-2006 03:52 AM
Re: find -perm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 03:57 AM
тАО07-11-2006 03:57 AM
Re: find -perm
find . -perm u=r -exec ll -d {} \;
That doesn't return anything.
I have a bunch of files that are
r--r-----
or
r--------
or
r--r--r--
and it doesn't find them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 03:59 AM
тАО07-11-2006 03:59 AM
Re: find -perm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:02 AM
тАО07-11-2006 04:02 AM
Re: find -perm
# ll
total 52
-rwx------ 1 pmofabxx sa 814 Sep 2 2004 .cshrc
-r-------- 1 pmofabxx sa 347 Sep 2 2004 .exrc
-rwx------ 1 pmofabxx sa 341 Sep 2 2004 .login
-rw------- 1 pmofabxx sa 74 Jul 11 12:13 .ltime
-rwx------ 1 pmofabxx sa 6398 Sep 2 2004 .profile
-r-------- 1 pmofabxx sa 446 Sep 2 2004 .profile.old
-rw------- 1 pmofabxx sa 3424 Jul 11 12:14 .sh_history
drwx------ 2 pmofabxx sa 96 Aug 16 2005 .ssh
drwx------ 5 pmofabxx sa 96 Jun 13 15:40 .sw
drwxrwxrwx 4 root dba 2048 Jun 13 17:55 EWCF
drwxrwxrwx 3 root dba 2048 Jun 13 17:55 FDE-
# find ./ -perm u=r -exec ll {} \;
-r-------- 1 pmofabxx sa 347 Sep 2 2004 ./.exrc
-r-------- 1 pmofabxx sa 446 Sep 2 2004 ./.profile.old
#
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:13 AM
тАО07-11-2006 04:13 AM
Re: find -perm
find . -type f \( -perm -004 -o -perm -044 -o -perm -444 -o -perm -040 -o -perm -440 -o -perm -400 -o -perm -404 \) -exec ls -l {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:19 AM
тАО07-11-2006 04:19 AM
Re: find -perm
for g in 0 1 2 3 4 5 6 7
do
for o in 0 1 2 3 4 5 6 7
do
find . -perm 04${g}${o} -exec ll {} \;
done
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:44 AM
тАО07-11-2006 04:44 AM
Re: find -perm
acs - your solution while not pretty might work, but there would be a whole lot more possible combinations to cover all of the possibilities.
ms - your solution would also work, but way to many find commands running to be a viable solution.
I was hoping that I just misunderstood the man page, and it could be done with one command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:49 AM
тАО07-11-2006 04:49 AM
Re: find -perm
that have exactly r--r--r-- mode set BUT -perm -444 (note the "-") will match rXXrXXrXX where X is "don't care".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:52 AM
тАО07-11-2006 04:52 AM
Re: find -perm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 05:23 AM
тАО07-11-2006 05:23 AM
Re: find -perm
Sorry for my mistake. But, I still have a problem, I do care about the rXX for the owner. I want it to find:
r--XXXXXX
but not any of the following:
rw-XXXXXX
r-xXXXXXX
rwxXXXXXX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 05:30 AM
тАО07-11-2006 05:30 AM
Re: find -perm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 03:04 PM
тАО07-11-2006 03:04 PM
Re: find -perm
find . -type f -exec ls -l {} \;
this should list all the files and Modes..
then simply Piple the output into GREP for the pattern (or Regular Expression) you so desire/want.
play with the "ll" command in a small sized directory:
cd small_directory
ll | grep " r[rxw-]"
use the grep following the above find command in a pipe:
find .... | grep ....
remember: UNIX tools are KISS (Keep It Small and Simple) and use "pipe"..
have fun.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 11:36 PM
тАО07-11-2006 11:36 PM
Re: find -perm
what about
find . ! -perm -200 -a ! -perm -500 | xargs ls -ld
mfG Peter