LinuxQuestions.org
Help answer threads with 0 replies.
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 03-26-2012, 07:06 AM   #1
grungesabin
LQ Newbie
 
Registered: Dec 2011
Posts: 11

Rep: Reputation: Disabled
command to list files with rwx permission


Hello all,
Can anyone please tell me the command which displays all the files and directories which has rwx permission for user
 
Old 03-26-2012, 07:25 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Hi,

Give this a try:
Code:
stat -c "%A %n" * | awk '/^.rwx/ { print $2 }'
Hope this helps.
 
Old 03-26-2012, 07:28 AM   #3
grungesabin
LQ Newbie
 
Registered: Dec 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
thankx but i was looking for something with find or ls .... is there any???
 
Old 03-26-2012, 07:41 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Hi,
Quote:
Originally Posted by grungesabin View Post
thankx but i was looking for something with find or ls .... is there any???
Give these a try:

Code:
ls -l | awk '/^.rwx/ { print $0 }'

find . -perm -700
Hope this helps.
 
Old 03-26-2012, 07:42 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Using find you can try the -perm predicate, e.g.
Code:
find . -type f -perm -u=rwx
The usage of -perm with find is a bit complex, since there are different ways to specify the permission mode (for example by octal or symbolic bits). Please, take a look at the official guide, here.
 
  


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
recursively list files and dirs based on permission sneakyimp Linux - Software 2 10-16-2007 07:37 PM
Read-only access to files that should be RWX DigitalScience LinuxQuestions.org Member Intro 2 01-18-2006 03:16 PM
Command to run another command against a list of files psweetma Linux - General 3 11-09-2005 06:29 PM
how to give 'guest' rwx permission on a file/directory RH9Linux Linux - Software 3 06-27-2005 09:59 PM
Command to list some files? AoiSora Programming 13 10-29-2003 05:37 PM

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

All times are GMT -5. The time now is 06:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration