Wednesday, August 13, 2008

Windows Command Line FIND instead of GREP

People have maybe heared of grep on linux boxes... today I wanted to do a small count for the appeareance on a windows box where we host a log file with 500k rows.

P:\>find /?Searches for a text string in a file or files.

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]

  • /V Displays all lines NOT containing the specified string.
  • /C Displays only the count of lines containing the string.
  • /N Displays line numbers with the displayed lines.
  • /I Ignores the case of characters when searching for the string.
  • /OFF[LINE] Do not skip files with offline attribute set.
  • "string" Specifies the text string to find.
  • [drive:][path]filename Specifies a file or files to search.

If a path is not specified, FIND searches the text typed at the promptor piped from another command.

update: otherwise you can also use qgrep: http://malektips.com/xp_dos_0011.html

No comments:

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge