command line

ค้นหาข้อความในไฟล์ด้วย command line

รูปภาพของ hiddenmin

เราสามารถค้นหาข้อความที่อยู่ในไฟล์ต่างได้ง่ายๆ ด้วยคำสั่ง grep โปรแกรม grep จะแสดงข้อความที่หาเจอในไฟล์ที่เราต้องการ

grep <string> <file path>

เช่น

amin@alpha:~$ grep nameserver /etc/resolv.conf
nameserver 172.16.0.23

Tags: 

Subscribe to RSS - command line