ค้นหาไฟล์ ของ user ในเครื่อง Linux ใช้ได้ทั้ง Ubunt CentOS

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: ค้นหาไฟล์ ของ user ในเครื่อง Linux ใช้ได้ทั้ง Ubunt CentOS

Re: ค้นหาไฟล์ ของ user ในเครื่อง Linux ใช้ได้ทั้ง Ubunt CentOS

โดย mindphp » 08/04/2017 2:36 pm

นอกจากนี้ ยังสามารถค้นหาโดยระบุเฉพาะ ประเภทของไฟล์

โค้ด: เลือกทั้งหมด

# find /var/www -user apache -name "*.php"

โค้ด: เลือกทั้งหมด

-name "*.php"
คือ หาไฟล์อะไรก็ได้นามสกุล .php

ค้นหาไฟล์ ของ user ในเครื่อง Linux ใช้ได้ทั้ง Ubunt CentOS

โดย mindphp » 08/04/2017 2:23 pm

คนหาไฟล์ ของ user ในเครื่อง #Linux ใช้ได้ทั้ง Ubuntu, CentOS
รูปแบบ คำสั่ง

โค้ด: เลือกทั้งหมด

find directory-location -user {username} -name {file-name}
ตัวอย่าง

โค้ด: เลือกทั้งหมด

find /home/mindphp/ -user apache -name "*"
ความหมาย
ค้นหาไฟ์ *(อะไรก็ได้) ใน folder /home/mindphp/ ที่มีเจ้าของไฟล์เป็น apache

ข้างบน