用 arp -a 來從 mac 查 ip
再用 nbtstat -A ip 來從 ip 查電腦名稱
netstat -an 指令查 電腦有那些Port有被開啟
我有強烈可怕的健忘問題,這是幫助自己記憶的網站,記憶了許多個人的事. 收錄許多資訊,防止資料不見或網站消失,供查找留存用。 如:筆記,訊息,記錄,生活,網路小品,趣味之事.... 希望我不要連整個Blog也一起忘記.
2014年7月15日 星期二
Grep For Windows – Findstr Example
在windows上使用grep,我覺得蠻實用的。
這是轉貼的文章,為了怕不見,我自己另外留一份copy.
http://www.mkyong.com/linux/grep-for-windows-findstr-example/
這是轉貼的文章,為了怕不見,我自己另外留一份copy.
http://www.mkyong.com/linux/grep-for-windows-findstr-example/
I love
grep
command on Linux, it helped to search and filter strings easily, always wonder what is the equivalent tool on Windows, and found this findstr
recently.
In this article, I will share some of my favorite “grep” examples on Linux, and how to “port” it to Windows with “findstr” command.
1. Filter a result
1.1 Classic example to filter a listing result.
#Linux $ ls -ls | grep mkyong #Windows c:\> dir | findstr mkyong
1.2 Add ignore case, and filter the listing result with multiple strings.
#Linux - Need '-E' option and Uses "|" to separate multiple search strings. $ ls -ls | grep -iE "mkyong|music" #Windows - Use spaces to separate multiple search strings c:\> dir | findstr -i "mkyong music"
2. Search a File
2.1 Search matched string in a file.
#Linux $ grep mkyong test.txt #Windows c:\> findstr mkyong test.txt
2.2 Counting the number of matches.
#Linux $ grep -c mkyong test.txt #Windows - Piped with find /c command. c:\> findstr -N "mkyong" test.txt | find /c ":"
3. Search a list of files
3.1 Search matched string in a list of files.
#Linux $ grep mkyong -lr /path/folder #Windows c:\> findstr /M mkyong c:\folder\*
* (grep) -l , (findstr) /M = print only name of files containing matches.
4. Help
4.1 The most powerful command ~
#Linux $ grep --help $ man grep #Windows c:\> findstr -?
Note
Do you have other examples? Does share it below, thanks.
Do you have other examples? Does share it below, thanks.
References
- 15 Practical Grep Command Examples In Linux / UNIX
- Wikipedia : Findstr
- Grep for Windows Using FINDSTR
訂閱:
文章 (Atom)
如何查看主機跟NAS連線的指令?
windows的VM或主機可以下 net use 或是 Get-SmbConnection 看有沒有關於連線到NAS storage的資訊. ================================================ 對於linux VM或主機可以下 net...
-
查詢AD帳號狀態,可查詢密碼到期時間,使用甚麼群組資訊.... 指令:net user AD_USERNAME /domain 例如AD帳號為test,則指令為: net user test /domain 或是要直接查當下的登入帳號,就輸入: > net user %us...
-
問題: 在某些特定情況,win10的控制台,無法開啟Mail(郵件)。 或是控制台內的郵件設定中圖示是空白,造成"找不到應用程式" Environment: OS: Win10 Pro Office: MS office 2016 ...
-
針對帳號鎖定進行問題分析如下: 特別是 4740 備註 :若要搜尋與帳號鎖定相關的事件記錄,以下是 Windows Server 2003 與 Windows Server 2008 的相關事件編號與相關描述。 Event ID (Win2k3) Event ID (Win2k...