dir /S /B *.php
Cory Foy
2008-12-05 20:11:48
You can use built-in DOS commands like so:
cd /d "[base-directory]" && dir /s /b *.php > [list file]
e.g.
cd /d "c:\my files" && dir /s /b *.php > c:\list.txt
If the simple:
dir /S /B *.php > output.txt
is not sufficient then Total Commander will certainly do the task. The multi rename tool in Total Commander is excelent.
Open a command prompt, cd to the folder you want to find files in and run
dir *.html /B /S > somefile.txt
then look in somefile.txt
(looks like I lose the race .... !)
If you don't mind installing Cygwin, the following one-liner will do the find-and-replace:
find basedir -name \*.php -exec sed -i 's/text-to-find/text-to-replace/g' '{}' '+'
sed
also support regular expressions, so the text-to-find can be a regex, and the text-to-replace can contain references to groups fro the pattern text.