Listing 000 permission files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Listing 000 permission files
# 1  
Old 06-01-2011
Listing 000 permission files

Hi all,

is there a way to list all files with 000 permission and not get "Permission denied" message?

I would like to have names of all those files in one text file.

At the moment, i have this "
Code:
find . -type d \( -name . -o -prune \) -perm 000   > text.txt

" and it is not working.

Can anyone help?

Thank you in advance and best regards,

Bruno

EDIT: my goal is to list folders, not files, sorry

Last edited by pludi; 06-01-2011 at 08:42 AM..
# 2  
Old 06-01-2011
The above command seems to work fine for me. Are you sure you have directories in your current directory with 000 permission..? Below is the format of the 0 permission directory in my machine.Is the below one is similar to yours ls -l..?
Code:
d--------- 2 own frp  1024 2011-06-01 07:34 mike

# 3  
Old 06-01-2011
redirect STDERR

Code:
find . -type d \( -name . -o -prune \) -perm 000   > text.txt 2>/dev/null

# 4  
Old 06-01-2011
Code:
d---------   2 usr      pvt2         512 May 31 15:41 yura

after executing command

Code:
find: cannot read dir ./yura: Permission denied

# 5  
Old 06-01-2011
Did you try the command given by frank_rizzo ?
# 6  
Old 06-01-2011
just tried it, it hides the message but the folder is not listed in .txt file
# 7  
Old 06-01-2011
So you only want files and directories in the current directory? That is you want to prohibit recursive searching? Then use: find . \( -name . -o -prune \) -perm 000. I just tested it. It found both files and directories in the current directory with 0 permissions. It ignored files in a subdirectory with 0 permissions.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Take 100MB worth files from 200,000 Files

Hi, I have a process which creates almost 200K files. Each file ranging from 1kb to 5kb. This is almost 2GB of data in all files. I have a requirement where the business needs only 100MB worth of files. Is there a way to get files around 100MB (doesn't have to be exactly 100MB) from all the... (2 Replies)
Discussion started by: grep_me
2 Replies

2. Shell Programming and Scripting

Can root user run chmod 000 permission shell script?

Hi, I have a shell script file which is set to access permission 000. When I login as root (sudo su) and try to run this script, I am getting the Permission denied error. I have read somewhere that root admin user can execute any kind of permission script. Then why this behavior? However, I can... (1 Reply)
Discussion started by: royalibrahim
1 Replies

3. Shell Programming and Scripting

Need help in creating 10,000 files in unix

hi all, I am an UNIX beginner. I need to create 10,000 .dat files in unix. and first file should have 10102009*1*14, second file should have 10102009*2*14, and the 10,000th file should contain 10102009*10000*14, (Comma is a must at end) The file name should be... (1 Reply)
Discussion started by: satishpv_2002
1 Replies

4. UNIX for Dummies Questions & Answers

file permission 000

hi all i was reading some questions related to file permission if file has 000 permission then who can read the file ? i think no one can read the file. correct me if i am wrong (4 Replies)
Discussion started by: zedex
4 Replies

5. News, Links, Events and Announcements

Microsoft "Donates" $3,000,000,000 to Feds

Surreal quote from the news link below: http://www.washingtonpost.com/wp-dyn/articles/A44615-2002Nov12.html (0 Replies)
Discussion started by: Neo
0 Replies

6. UNIX for Dummies Questions & Answers

Recursive directory listing without listing files

Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories. The following command also shows the files but I only want to see the directories. ls -lrtR * (4 Replies)
Discussion started by: psingh
4 Replies
Login or Register to Ask a Question