Vixual / 122 posts / tags / 62 comments / feed / comments feed /
Search:

[轉載]Linux 的搜尋技巧

轉載自: Sam Tang @ Blog


在檔案內搜尋指定文字,search_key 是搜尋字串,/path/to/filename 是檔案名稱:

grep search_key /path/to/filename

功能同上,但不分大小寫:

grep -i search_key /path/to/filename

搜尋檔案:在指定目錄中搜尋檔案,以下是在 /var/www/ 目錄下搜尋 upload.php 的檔案:

find /var/www/ -name upload.php

功能同上,但目標不是檔案,而是目錄:

find /var/www/ -name uploads -type d

還有更多有用的功能,以上只列出較常用的用法。

收藏至網路書籤: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Google
  • Live
  • YahooMyWeb
  • MyShare
  • Hemidemi
  • Funp

您可能會對以下這些文章感興趣

您對這篇文章的評價:
1 Star2 Stars3 Stars4 Stars5 Stars (有 1 人給予評價)
Loading ... Loading ...

沒有任何留言

發表您的評論

(您的留言會在審核後才能公開)