Find without the "Permission non granted" list ...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find without the "Permission non granted" list ...
# 1  
Old 11-06-2010
Find without the "Permission non granted" list ...

Hi,

When I use the Find command under the root directory ("/") of my Ubuntu, I get the good answers mixed inside a long list of "Permission non granted" (in fact and with my French version, I get "Permission non accordée" !).

After several unsuccessful tries with -perm or -executable options (or with -prune action), I've found no simple way to avoid that. Maybe not so simple ... :-(

My goal : Turning off the warnings given by 'find' started on any directory of the system, and typically "/". These warnings "pollute" the result inusefully !

Thank's for your help,

Micla
# 2  
Old 11-06-2010
Hi.

You could always just throw the errors away:

Code:
find / ..... 2> /dev/null

# 3  
Old 11-06-2010
Well ... I should have been more precise in my initial question (maybe I'm slightly purist too !) :

I'm looking for a way to do that job inside the find command, so as to avoid external processings, such as shell ones.

In the case where "Find" would bring other interesting warnings on the error output, I would like to be able to catch them. I am really looking for an inside-find solution to remove selectively these particular warnings ...! ;-/

And I must say that I am surprised to see the great amount of particular case taken in account in "find" and nothing (at least found by me) for this seemingly-simple pb !!!
# 4  
Old 11-07-2010
Hi,

I don't know if this solution could be useful to you, but I would discard the result using 'awk'. Here a sample in my own system. The regular expresion of 'Permission not granted' is in spanish, but change it for your needs:
Code:
find / -iname "*pacman*" -print 2>&1 | awk 'BEGIN {IGNORECASE=1;} $0 !~ /permiso denegado/ {print}'

Regards,
Birei

Last edited by birei; 11-07-2010 at 06:11 PM..
# 5  
Old 11-07-2010
As per my experience. On Ubuntu even with admin user you are not allowed to access all files by default.
Either become root by executing "sudo su -"
or run find command with sudo

sudo find / .... XYZ

If you still wish to run it without sudo

find ./ .... XYZ 2> /tmp/perm.txt

Last edited by mtomar; 11-07-2010 at 08:23 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find . -path "*_nobackup*" -prune -iname "*.PDF" \( ! -name "*_nobackup.*" \)

These three finds worked as expected: $ find . -iname "*.PDF" $ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \) $ find . -path "*_nobackup*" -prune -iname "*.PDF" They all returned the match: ./folder/file.pdf :b: This find returned no matches: $ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies

2. Shell Programming and Scripting

How to find a file which are not ends with ".zip" and which are ends with "*.log*" or "*.out*"?

I am new to bash/shell scripting. I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”. I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
Discussion started by: Mallikgm
4 Replies

3. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

4. Shell Programming and Scripting

Read from "list1" and list matches in "list2"

I want to print any matching IP addresse in List1 with List 2; List 1 List of IP addresses; 161.85.58.210 250.57.15.129 217.23.162.249 74.76.129.101 30.221.177.237 3.147.200.59 170.58.142.64 127.65.109.33 150.167.242.146 223.3.20.186 25.181.180.99 2.55.199.32 (3 Replies)
Discussion started by: lewk
3 Replies

5. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

BASH find filenames in list that match certain "pattern."

I guess by "pattern," I mean something different from how that word is defined in the Linux world. If you take $ to mean a letter (a-z) and # to mean a number (0-9), then the pattern I'm trying to match is as follows: $$$##-####-###-###.jpg I'd like to write a script that reads in a list of files... (4 Replies)
Discussion started by: SilversleevesX
4 Replies

8. Shell Programming and Scripting

what does "s" stand for in the permission list -rwsr-sr-x?

-rwsr-sr-x I have a permission like this. What does s stand for and how do we represent this in numbers? like 755, 744 etc., (2 Replies)
Discussion started by: sagar_evc
2 Replies

9. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

10. Shell Programming and Scripting

grep to find content in between curly braces, "{" and "},"

problem String ~~~~~~~~~~~~~~~~~~ icecream= { smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" } aend = {smart vc4 eatr kalu} output needed ~~~~~~~~~~~~~~~~~~ smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies
Login or Register to Ask a Question