iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 8
0
自我挑戰組

挑戰30天-學習52個最常用的 Windows Command Line !系列 第 8

Day8."Find" 指令如何使用?

Find 指令描述:搜尋一或多個檔案中的文字字串。
要看 Find Command怎麼使用的方式是:
1.cmd --> find /?
2.cmd --> help find
3.查看 Microsoft Command Line 網站:
https://docs.microsoft.com/zh-tw/windows-server/administration/windows-commands/find

語法:
FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]

/V 顯示所有不包含指定字串的行。
/C 只顯示包含字串的行數。
/N 顯示每一行及它的行號。
/I 當搜尋字串時,忽略字元的大小寫。
/OFF[LINE] 不要略過有離線屬性集的檔案。
"string" 指定要尋找的文字字串。
[drive:][path]filename
指定要搜尋的一或多個檔案。

如果沒有指定路徑,FIND 會搜尋在提示時所輸入的文字
或者在其他的命令中搜尋。

範例一、搭配 wmic指令找出已安裝的 hotfix
wmic qfe list full | find "KB4574727"
https://ithelp.ithome.com.tw/upload/images/20200923/2001093150HR01Gial.png

範例二、搭配 netstat指令找出已連線的 443 Port
netstat -an | find "443"
https://ithelp.ithome.com.tw/upload/images/20200923/20010931NBUSrsqu7k.png


上一篇
Day7."FC" 指令如何使用?
下一篇
Day9."getmac"指令如何使用?
系列文
挑戰30天-學習52個最常用的 Windows Command Line !9
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言