LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 06: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, 06:25 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Give this a try:
Code:
stat -c "%A %n" * | awk '/^.rwx/ { print $2 }'
Hope this helps.
 
Old 03-26-2012, 06: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, 06:41 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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, 06:42 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

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

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

All times are GMT -5. The time now is 07:48 AM.

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