|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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) ------------------------------- |
|
#2
|
||||
|
||||
|
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) |
|
#3
|
||||
|
||||
|
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. |
|
#4
|
||||
|
||||
|
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. |
|
#5
|
||||
|
||||
|
You can also look at the phpinfo() page. The php.ini file's location is identified there as well.
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Find command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|