wherewhere
指定された検索パターンに一致するファイルの場所を表示します。Displays the location of files that match the given search pattern.
構文Syntax
where [/r <Dir>] [/q] [/f] [/t] [$<ENV>:|<Path>:]<Pattern>[ ...]
パラメーターParameters
パラメーターParameter | 説明Description |
---|---|
r <Dir>/r <Dir> | 指定されたディレクトリから始まる再帰検索を示します。Indicates a recursive search, starting with the specified directory. |
/q/q | 一致するファイルの一覧を表示せずに、終了コード (成功の場合は 0 、失敗の場合は 1 ) を返します。Returns an exit code (0 for success, 1 for failure) without displaying the list of matched files. |
/f/f | Where コマンドの結果を引用符で囲んで表示します。Displays the results of the where command in quotation marks. |
/t/t | ファイルのサイズと、一致した各ファイルの最終更新日時を表示します。Displays the file size and the last modified date and time of each matched file. |
[$<ENV>:|<Path>:]<Pattern>[ ...][$<ENV>:|<Path>:]<Pattern>[ ...] | 一致するファイルの検索パターンを指定します。Specifies the search pattern for the files to match. 少なくとも1つのパターンが必要であり、パターンにはワイルドカード文字 (* と ?) を含めることができます。At least one pattern is required, and the pattern can include wildcard characters (* and ?). 既定では、は、現在のディレクトリと PATH 環境変数で指定されているパス を検索し ます。By default, where searches the current directory and the paths that are specified in the PATH environment variable. 別のパスを指定するには、$env:pattern ( ENV は1つ以上のパスを含む既存の環境変数) を使用するか、 path:pattern という形式を使用します (ここで、 path は検索するディレクトリパスです)。You can specify a different path to search by using the format $ENV:Pattern (where ENV is an existing environment variable containing one or more paths) or by using the format Path:Pattern (where Path is the directory path you want to search). これらの省略可能な形式は、 /r コマンドラインオプションと共に使用することはできません。These optional formats should not be used with the /r command-line option. |
/?/? | コマンド プロンプトにヘルプを表示します。Displays help at the command prompt. |
解説Remarks
- ファイル名拡張子を指定しない場合、PATHEXT 環境変数に記載されている拡張子が既定でパターンに追加されます。If you do not specify a file name extension, the extensions listed in the PATHEXT environment variable are appended to the pattern by default.
- では、再帰的な検索を実行したり、日付やサイズなどのファイル情報を表示したり、ローカルコンピューター上のパスの代わりに環境変数を使用し たりできます。Where can run recursive searches, display file information such as date or size, and accept environment variables in place of paths on local computers.
例Examples
現在のコンピューターとそのサブディレクトリの C ドライブにある Test という名前のすべてのファイルを検索するには、次のように入力します。To find all files named Test in drive C of the current computer and its subdirectories, type:
where /r c:\ test
パブリックディレクトリ内のすべてのファイルを一覧表示するには、次のように入力します。To list all files in the Public directory, type:
where $public:*.*
リモートコンピューターのドライブ C、Computer1、およびそのサブディレクトリにあるメモ帳という名前のすべてのファイルを検索するには、次のように入力します。To find all files named Notepad in drive C of the remote computer, Computer1, and its subdirectories, type:
where /r \\computer1\c notepad.*