web analytics

WHICH command for DOS

If You need the analog of Unix ‘which’ command and do not have Resource Kit, the following batch file will help. The code was found on www.ss64.com Published with the permission of the author, Clay Calvert.

@echo off SETLOCAL (set WF=) :: Look for file in the current directory for %%a in ("" %!!%) do […]

grep in find command: how to display file names

Here is very simple trick to force the grep command to display file name, when it’s used together with find operation. Just write /dev/null as the “second file”

find . -type f -exec grep somestring {} /dev/null \;