Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Kalifa
Femeie
24 ani
Ialomita
cauta Barbat
24 - 65 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [WINDOWS] Advanced Search in Windows Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
Mrrrr
AdMiN

Inregistrat: acum 18 ani
Postari: 2265
keywords: search files command prompt CMD

This seems much faster than regular Windows search if you are looking for a specific file:

where /r C:\ filename.ext

/r — recursive search
C:\ — starting directory
filename.ext — full or partial file name
🔸 Example: where /r C:\ notepad.exe

Cancel any command that is running with CTRL+C in cmd window.

The ones below have limitations.
Check post #3 in this topic for advanced searching with default Windows Search.

🔍 1. Search with Wildcards

dir /s /b C:\*.xml

/s - search subdirectories
/b - bare output (just paths)
🔸 Example: dir /s /b *.apk

🔎 2. Find File Content with findstr

findstr /s /i /n "someText" *.txt

/s - recursive
/i - case-insensitive
/n - shows line numbers
🔸 Example: Search for "main" inside .java files: findstr /s /i "main" *.java

🔎3. You can even combine with search with wildcards

dir /s /b *.smali | findstr "Constantes"


🔎 4. Use forfiles to Find by Date/Size

forfiles /p "C:\Projects" /s /m *.apk /d -7

/p - path
/s - recurse
/m - file mask
/d -7 - modified in last 7 days

🔎 5. Use PowerShell for More Power

Find all .xml files containing android:label:

Get-ChildItem -Recurse -Filter *.xml | Select-String "android:label"


Find all .xlsx files:

Get-ChildItem -Recurse -Include *.xlsx -Path C:\ -ErrorAction SilentlyContinue


_______________________________________


pus acum 7 zile
   
TRaP
Moderator

Inregistrat: acum 7 ani
Postari: 846
For non-txt files the above from 2 causes errors (Cannot open for PDF and sometimes for some DOC files).
For doc files it tries to bring text from those files, filling cmd with paragraphs and other unknown characters.

The following command will list only the paths of the files, but for PDFs it still says "Cannot open".

findstr /s /m /i "periculoase" *.*

/s - recurse into subfolders
/m - only print the filename of files containing the match
/i - case-insensitive

PowerShell - better option
will search doc, docx, xls, xlsx just fine, but will not search inside PDF files

Get-ChildItem -Recurse -File |
Where-Object {
    try {
        Select-String -Path $_.FullName -Pattern "periculoase" -Quiet
    } catch {
        $false
    }
} |
Select-Object -ExpandProperty FullName

or the same but as a one-liner

Get-ChildItem -Recurse -File | Where-Object {try {Select-String -Path $_.FullName -Pattern "periculoase" -Quiet} catch {$false}} | Select-Object -ExpandProperty FullName


pus acum 6 zile
   
TRaP
Moderator

Inregistrat: acum 7 ani
Postari: 846
Under Windows, is best to use the advanced operators available for the native search function/field in Explorer.

===========================================
📄 WINDOWS EXPLORER SEARCH - CHEAT SHEET
(for Windows 10 & 11)
===========================================

📝 Basic Search Operators
--------------------------

✅ Search in file content:
content:periculoase
content:"substante periculoase"

✅ Search by file name:
name:report

✅ Search for exact phrase in file names:
"exact phrase"

✅ Use wildcards:
report*.docx
*.txt

✅ Logical operators (must be UPPERCASE):
dog OR cat
dog AND cat
dog NOT cat

✅ Exclude files:
NOT *.pdf

===========================================

📂 File Type and Kind
--------------------------

✅ Search specific extensions:
*.txt
*.docx
*.pdf

✅ Search by kind of file:
kind:=document
kind:=picture
kind:=music
kind:=video
kind:=email

✅ Search by type (uses metadata):
type:pdf
type:jpeg
type:word

===========================================

📅 Date Filters
--------------------------

✅ Modified date:
datemodified:>=01/01/2024
datemodified:this week
datemodified:last month
datemodified:>=2024-06-01 <=2024-06-30

✅ Created date:
datecreated:yesterday
datecreated:this year

===========================================

📏 Size Filters
--------------------------

✅ File size:
size:>10MB
size:<1MB
size:500KB..10MB

===========================================

🧪 Combined Example
--------------------------

content:invoice type:pdf datemodified:this year size:<5MB

→ PDFs under 5MB, modified this year, containing “invoice”.

===========================================

🔗 Shortcuts & Tips
--------------------------

📌 Jump to Search Bar:
Ctrl + E  or  F3

📌 Use the SEARCH tab in Explorer ribbon to:
- Filter by Kind, Date Modified, Size, etc.
- Save searches for later use.

📌 Searching indexed locations (Documents, Desktop) is faster.
📌 Add more folders to be indexed in:
Control Panel → Indexing Options

===========================================

🌟 Notes
--------------------------

🔷 `content:` can search inside PDFs & Office files
   — if the appropriate iFilter is installed
   — usually installed with Office & Adobe Reader

🔷 Searching unindexed folders may be slow.

===========================================

EXAMPLES
--------------------------

📄 Find all PDFs modified this year that contain "budget":
content:budget type:pdf datemodified:this year

📄 Find all documents larger than 10 MB:
kind:=document size:>10MB

📄 Find all Word or Excel files NOT containing "draft":
(type:docx OR type:xlsx) NOT content:draft

📄 Find pictures created last month:
kind:=picture datecreated:last month

===========================================

💡 Tip: You can save search queries by clicking
"Save Search" in the SEARCH tab.



Source: ChatGPT


pus acum 6 zile
   
Pagini: 1  

Mergi la