Linux – How to find file with name=“php.ini” on linux using grep command

command linegreplinux

How to find file with name="php.ini" on linux using grep command ? Can anybody show me ?

Best Answer

You would normally use find not grep to find files by name.

find / -name php.ini

If you must use grep

cd /; ls -lR | grep php.ini

In both cases replace "/" with the absolute or relative path for the directory you wish to start the search in.

Note that linux also has a locate command that relies on indexing - check it's man page for details. This is fastest if the right locations are indexed.

Related Question