command line find file code example

Example 1: cmd find file dir

# EXAMPLE: show all files that start with abc in the current directory (option: only show filepaths)
dir /b "abc*" 

# SYNTAX
# dir <your-options-or-switches> "<what-you-are-looking-for>"

# OPTIONS
# /b    :    Show only filenames 
# /a-d  :    Show files only (no folders)
# /ad   :    Show folders only (no files)
# /s    :    Include the subfolders in the search

# https://www.dummies.com/computers/operating-systems/windows-xp-vista/how-to-search-for-files-from-the-dos-command-prompt/

Example 2: find linux with extension

find /home/username/ -name "*.err"

Example 3: command line windows find file

dir secret.doc /s /p

Example 4: linux find file

# syntax 
# find *</path/to/dir> '(' *<Filter-1> *<and/or-operator> *<filter-2> ')'

# example 
find . '(' -name "Test*.pm" -a ! -name 'Useless*' ')'