Windows Command Line notes

This pages lists useful things that can be done by typing commands on a Windows computer!

Notes:

All Windows commands

Commands can be typed in a cmd, Windows PowerShell or, better, in a Windows Terminal!

pipe (|) and redirection

Using command redirection operators

how to redirect output from PowerShell to text files

Windows equivalent of Linux commands

Sections below: Linux command ⇔ Windows command

find ⇔ forfiles

What: recursively find files (filenames) matching a given pattern

Documentation: forfiles, forfiles (Wikipedia)

Linux example: find path -n '*somename*.nc' -ls

Windows example:

PS C:\> forfiles /p C:\Utils\miniconda3_2024-03\pkgs /m *ffi*.dll /s /c "cmd /c echo @fdate @ftime @relpath"
09/11/2021 22:16:18 ".\libffi-3.4.2-h8ffe710_5\Library\bin\ffi-8.dll"
10/05/2023 13:03:16 ".\libffi-3.4.4-hd77b12b_0\Library\bin\ffi-7.dll"
10/05/2023 13:03:16 ".\libffi-3.4.4-hd77b12b_0\Library\bin\ffi-8.dll"
10/05/2023 13:03:16 ".\libffi-3.4.4-hd77b12b_0\Library\bin\ffi.dll"
11/02/2025 09:56:52 ".\libffi-3.4.6-h537db12_0\Library\bin\ffi-8.dll"
31/03/2025 17:25:29 ".\libffi-3.4.6-h537db12_1\Library\bin\ffi-8.dll"

grep ⇔ find, findstr

What: search for a string of text in a file or files

To search for a string with wild cards and regex patterns, you can use the FINDSTR command

findstr can also search subdirectories

Documentation:

find, find (Wikipedia)

findstr, findstr (Wikepedia)

Linux example:

Windows example:

[ PMIP3 Wiki Home ] - [ Help! ] - [ Wiki syntax ]