Windows下与Linux命令wc -l等价的是什么? [英] What is the windows equivalent of Linux command wc -l?

查看:1017
本文介绍了Windows下与Linux命令wc -l等价的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一段代码旨在将以下内容发送到linux命令行:

wc -l C:/inputdirectory/P *

但是,我需要在Windows中运行此脚本,并试图找到等效的命令.我尝试过

找到/c/v C:/inputdirectory/P *

但这会引发错误,因为/v不是有效命令.你能告诉我为什么这不起作用吗?

*请注意,该命令本身未显示"inputdirectory",它具有正确的目录,太繁琐且私有,无法键入

解决方案

Eryk Sun 的礼貌:

尝试搜索"",即一个空字符串;仅使用反斜杠作为路径分隔符;并在路径中加空格的情况下加引号:

find /c /v "" "C:\inputdirectory\P*"

I have a piece of code that is meant to send the following to the linux command line:

wc -l C:/inputdirectory/P*

However, I need to run this script in Windows, and am trying to find the equivalent command. I have tried

find /c /v C:/inputdirectory/P*

But this throws an error, that /v is not a valid command. Can you please tell me why this isn't working?

*note, the command itself doesn't say "inputdirectory", it has the correct directory, it's just too tedious and private to type out

解决方案

Courtesy of Eryk Sun:

Try searching for "", i.e. an empty string; use only backslash as the path separator; and quote the path if it has spaces in it:

find /c /v "" "C:\inputdirectory\P*"

这篇关于Windows下与Linux命令wc -l等价的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆