0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Linucレベル1勉強メモ #24

Posted at

# 第二章 ファイル・ディレクトリの操作と管理

練習問題2.9
locateコマンドが利用するファイル名データベースを更新するコマンドを記述してください。

(解答)updatedb

(解説)locateコマンドは、あらかじめ作成されたファイル名データベースに基づいて検索します。ファイル名データベースの更新にはupdatedbコマンドを使います。このコマンドを実行するにはrootユーザーの権限が必要です。

ファイルの検索に使われるコマンド

  • locateコマンド
    あらかじめ作成されたデータベースに基づいて、指定されたパターンに一致するファイルを作成します。findコマンドよりも高速に動作します。
    locate 検索パターン
  • updatedb コマンド
    locateコマンドは、あらかじめ作成されたファイル名データベースに基づいて検索するので、findコマンドよりも高速に動作します。しかし、当然ながらデータベースの更新後に作成・変更されたファイルは見つけることができません。データベースを更新するには、updatedbコマンドを実行します。
    書式 updatedb [オプション]
    -e パス でデータベースに取り込まないパスを指定する。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?