想在windows下使用命令來查找文件,可以使用如下命令:where
命令的格式如下:
WHERE [/R dir] [/Q] [/F] [/T] pattern...
Description:
Displays the location of files that match the search pattern.
By default, the search is done along the current directory and
in the paths specified by the PATH environment variable.
Parameter List:
/R Recursively searches and displays the files that match the
given pattern starting from the specified directory.
/Q Returns only the exit code, without displaying the list
of matched files. (quite mode)
/F Displays the matched filename in double quotes.
/T Displays the file size, last modified date and time for all
matched files.
pattern Specifies the search pattern for the files to match.
Wildcards * and ? can be used in the pattern. The
"$env:pattern" and "path:pattern" formats can also be
specified, where "env" is an environment variable and
the search is done in the specified paths of the "env"
environment variable. These formats should not be used
with /R. The search is also done by appending the
extensions of the PATHEXT variable to the pattern.
/? Displays this help message.
NOTE: The tool returns an error level of 0 if the search is
successful, of 1 if the search is unsuccessful and
of 2 for failures or errors.
Examples:
WHERE /?
WHERE myfilename1 myfile????.*
WHERE $windir:*.*
WHERE /R c:\windows *.exe *.dll *.bat
WHERE /Q ??.???
WHERE "c:\windows;c:\windows\system32:*.dll"
WHERE /F /T *.dll
我們想查找文件內容的命令是:find或者findstr
在linux下的查找文件的命令也是 : where
也可以使用find -name
查找文件的內容的話,可以使用grep ,支持正則表達式,使用起來也很方便,再加上管道,有的時候會覺得特別的方便和快捷。
windows查找文件命令
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
windows命令總結
MLieV
2020-06-10 02:49:51
windows下複製文件命令
wyj1986
2020-02-25 09:10:19
Windows系統命令使用
wilypeg
2020-02-22 04:42:39
windows命令總結
MLieV
2020-06-10 02:49:51
Window配置端口映射,轉發請求
常写写代码
2020-06-01 10:31:10
windows下複製文件命令
wyj1986
2020-02-25 09:10:19
Windows系統命令使用
wilypeg
2020-02-22 04:42:39
windows的常用命令(詳細通俗易懂)
PZ&WM
2019-10-28 05:48:35
轉載 筆記本自帶鍵盤的開啓關閉
TheMoonRiver
2019-04-18 21:28:38
通過BAT腳本直接從apk文件獲取包名和安裝APK
yunshouhu
2019-04-14 01:49:35
net user使用方法
csrymh
2019-02-22 22:20:05
Win10下啓用Windows照片查看器
tianma3798
2019-02-22 21:48:13
DOS命令查看完整的Windows系統信息方法
tianma3798
2019-02-22 21:48:08
Windows批處理符號簡介、常用Dos命令
tianma3798
2019-02-22 21:48:06
windows系統獲取mac地址命令
tianma3798
2019-02-22 21:48:06