The following batch file I wrote demonstrates what I want
but I would like to know if there's a way to do it without a batch file.
@echo off for /r %%i in (.) do if %%~nxi==.git echo %%i
You can do this from the command line by making the following changes:
Replace
%%
with%
Replace
if
with@
if` to remove superfluous output
So the command becomes:
for /r %i in (.) do @if %~nxi==.git echo %i
If the output is more than one screenfull you can either:
Pipe the output to
more
for /r %i in (.) do @if %~nxi==.git echo %i | more
Or:
Redirect the output to a file and examine it later.
for /r %i in (.) do @if %~nxi==.git echo %i > output.txt more output.txt
- An A-Z Index of the Windows CMD command line
- A categorized list of Windows CMD commands
- echo - Display messages on screen, turn command-echoing on or off.
- for /r - Loop through files (Recurse subfolders).
- more - Display output one screen at a time. MORE can be used to run any executable command (or batch file) and pause the screen output one screen at a time.
- parameters - A command line argument (or parameter) is any value passed into a batch script.
- redirection - Redirection operators.