หาเป้าหมายและทำ command อื่นต่อ

Wednesday, January 25th, 2012

บางครั้งต้องการหาไฟล์หรือ ไดเรคทอรี ซึ่งไม่รู้อยู่ ณ จุดไหน ถ้าเจอแล้วต้องทำอะไรต่อ เราสามารถทำได้โดยใช้คำสั่ง Find การค้นหา directory หรือ ชื่อไฟล์ใน directory ที่ต้องการค้น Linux command “.” หมายถึง current directory ในการกรณีไม่ใส่ path ในการค้นหา find [pathnames] [conditions]   find . -name "[file name or directory name]" ตัวอย่าง find /home/data/ -name "*.log" find . -name "*data*.*"find [pathnames] [conditions] find . -name "[file name or directory name]" ตัวอย่าง […]