Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
相当于Linux的Windows:Find-name_Windows_Powershell_Command Line_Command Prompt - Fatal编程技术网

相当于Linux的Windows:Find-name

相当于Linux的Windows:Find-name,windows,powershell,command-line,command-prompt,Windows,Powershell,Command Line,Command Prompt,我试图在CLI中找到一个命令,我在Linux Ubuntu中知道这个命令,但我需要在Microsoft中应用它 此外,我正在尝试查找文件夹中具有特定名称的所有文件。特别是,我尝试查找名称中包含术语“test”的所有文件。 以下是我在Linux中知道的命令: find \home\user\data -name '*test*' 有人知道windows命令行中的等效项吗?您将查找Get ChildItem 您将查找Get ChildItem 在PowerShell中,您可以使用查找文件和文件夹

我试图在CLI中找到一个命令,我在Linux Ubuntu中知道这个命令,但我需要在Microsoft中应用它

此外,我正在尝试查找文件夹中具有特定名称的所有文件。特别是,我尝试查找名称中包含术语“test”的所有文件。 以下是我在Linux中知道的命令:

find \home\user\data -name '*test*'
有人知道windows命令行中的等效项吗?

您将查找Get ChildItem

您将查找Get ChildItem

在PowerShell中,您可以使用查找文件和文件夹

若要使用正则表达式,可以将Get-ChildItem和或cmdlet结合使用

Get ChildItem-路径C:\-递归|选择字符串-模式正则表达式 Get-ChildItem-Path C:\-Recurse | Where-Object-FilterScript{$\u0.name-match regex} 在PowerShell中,您可以使用查找文件和文件夹

若要使用正则表达式,可以将Get-ChildItem和或cmdlet结合使用

Get ChildItem-路径C:\-递归|选择字符串-模式正则表达式 Get-ChildItem-Path C:\-Recurse | Where-Object-FilterScript{$\u0.name-match regex}
您正在寻找dir命令。要完成与原始搜索相同的任务,可以使用

dir \home\user\data "*test*"

您正在寻找dir命令。要完成与原始搜索相同的任务,可以使用

dir \home\user\data "*test*"

dir是get childitem的别名。Get Alias dirdir是Get childitem的别名。Get Alias Dir您可以添加-Recurse以在子文件夹中搜索。您可以添加-Recurse以在子文件夹中搜索。我相信前面的所有答案对于Windows都是不错的选择。在我的例子中,我希望尽可能精确地模拟Linux命令,以复制我的CI服务器环境。所以,我发现旧的find命令也适用于Windows。我相信前面所有的答案对于Windows来说都是不错的选择。在我的例子中,我希望尽可能精确地模拟Linux命令,以复制我的CI服务器环境。所以,我发现旧的find命令也适用于Windows。