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 06-09-2008, 02:29 PM   #1
mack1e
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Rep: Reputation: 0
"Permission denied" and "recursive directory loop" when searching for string in files


I am trying to find which file contains the line "GLOBAL_BIN" in the body. Im using RHEL AS 4 and used these commands to do so but kept getting the "grep:....Permission denied" and "grep:....recursive directory loop" messages for all the output lines.

1)find / -type f | xargs grep -l GLOBAL_BIN
2)grep -r -I -D skip "GLOBAL_BIN" /


Can anyone shed light? maybe a syntax tweak? I am wondering why "permission denied" and "recursive directory loop" is returned here...yes Im green at this :P
 
Old 06-09-2008, 03:12 PM   #2
lwasserm
Member
 
Registered: Mar 2008
Location: Baltimore Md
Distribution: ubuntu
Posts: 184

Rep: Reputation: 41
Try running the grep -r command as root. The permission denied message is just when you try to access a file that you don't have permission to read as a normal user.
 
Old 06-10-2008, 08:35 AM   #3
mack1e
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Original Poster
Rep: Reputation: 0
thanks for your reply but I am running as root:

[root@redbox ~]# grep -r -I -D skip "GLOBAL_BIN" / | less
grep: /root/.kde/socket-redbox: No such file or directory
grep: /root/.kde/tmp-redbox: No such file or directory
grep: /sys/module/dm_mirror/dm_mirror_error_on_log_failure: Permission denied
grep: warning: /sys/block/hdc/device/block: recursive directory loop

...thats why this threw me even more because if Im getting perms denied for root access...wtf?
 
Old 06-10-2008, 09:31 AM   #4
lwasserm
Member
 
Registered: Mar 2008
Location: Baltimore Md
Distribution: ubuntu
Posts: 184

Rep: Reputation: 41
For the purpose of your search you can probably ignore these errors. My guess would be that the files with redbox in the name are broken symbolic links. The files in the /sys directory are not permanent files, they are created by the kernel to make access to various internal states available. Some of them are write-only and this is probably what is causing the permission error. Hope this helps.
 
Old 06-10-2008, 06:41 PM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Try redirecting stderr to null eg

grep -r -I -D skip "GLOBAL_BIN" / 2>/dev/null
 
Old 06-12-2008, 07:38 AM   #6
mack1e
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Original Poster
Rep: Reputation: 0
maybe i needed sleep....came back and did a : "locate Bastille" (the program I am actually trying to get working) and observed all the paths that came out. I then cd'd into those paths (i.e. /usr/lib/Bastille, usr/sbin, etc) and did: grep GLOBAL_BIN* and voila, the file I was looking for with that entry is "API.pm"...but now Im past that im getting a different error
 
  


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
NFS problem: "Could not chdir to home directory /home/USER: Permission denied" sumanc Linux - Server 4 07-22-2010 04:12 PM
"Permission denied" when trying to copy files into mounted windows with all rights twist3r Linux - Newbie 14 05-06-2008 05:30 PM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-29-2004 11:18 PM
Keep getting "Permission Denied" when trying to write files dunnd40 Debian 2 02-01-2004 10:29 AM
Can't access mounted NFS directory: "permission denied" SparceMatrix Linux - General 6 03-08-2003 01:36 PM


All times are GMT -5. The time now is 11:42 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration