SunQuest
           Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old January 15th, 2003, 10:02 AM
beardo's Avatar
beardo beardo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: Cheltenham, UK
Posts: 197 beardo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 14 h 11 m 13 sec
Reputation Power: 8
Find command

Hi,

This may seem like a basic and rather silly question but I can't find the answer anywhere else!

I am trying to locate my php.ini file on a shared virtual hosting system using:

find / -name *php.ini*

Problem is that it lists far too many results and alot of the results include 'Permission denied'

Is there anyway to filter out the Permission denied
files?
Is there anyway to limit the number of results?

Thanks,
__________________
beardo ;0)
-------------------------------

Reply With Quote
  #2  
Old January 15th, 2003, 10:56 AM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
If you are just looking for a file called php.ini then this command will find any files called php.ini on your filesystem:

Code:
find / -name php.ini


If you want to get rid of all the "Permission Denied" errors, then do this:

Code:
find / -name php.ini 2> /dev/null


This redirects any errors to a blackhole.

If you want to display the results one page at a time, then do this:

Code:
find / -name php.ini 2> /dev/null | more


This sends the results to the "more" pager, which lets you view them one page at a time. Hit space to view the next page.

Finally, if you know part of the file path, then you can filter the results by that. For example, if you know it was in a directory called conf, this filter will only return php.ini files in your home

Code:
find / -name php.ini 2> /dev/null | grep conf


Hope this helps!
__________________
Alex
(http://www.alex-greg.com)

Reply With Quote
  #3  
Old January 15th, 2003, 11:01 AM
beardo's Avatar
beardo beardo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: Cheltenham, UK
Posts: 197 beardo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 14 h 11 m 13 sec
Reputation Power: 8
Thank You!

Hi Alex,

You are a well-mannered and considerate man with high standards of proper behavior - a gentleman.

Many thanks for your time.

Reply With Quote
  #4  
Old January 15th, 2003, 07:16 PM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,913 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 17
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
On a sidenote - you might want to take a look at locate. It requires you to updatedb every so often, but speedwise it is significantly better. And easier to use as well.
__________________
And you know I mean that.

Reply With Quote
  #5  
Old January 15th, 2003, 08:26 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
You can also look at the phpinfo() page. The php.ini file's location is identified there as well.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Find command


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway