【问题标题】:What is the Windows/DOS equivalent of the *nix head and tail commands? [duplicate]*nix head 和 tail 命令的 Windows/DOS 等效项是什么? [复制]
【发布时间】:2013-01-03 21:13:04
【问题描述】:

可能重复:
Looking for a windows equivalent of the unix tail command
Windows equivalent of the 'tail' command

我需要存储一个巨大(数 GB)XML 文件的前 100 行和最后 100 行。在 *nix 上,我会这样做:

head -n 100 foo.xml > foo.txt
tail -n 100 foo.xml >> foo.txt

如何在 Windows/DOS 命令提示符下执行相同操作?

注意:我宁愿不必安装任何东西。

【问题讨论】:

  • @RobertHarvey 有什么方法可以在不安装任何东西的情况下获得tail
  • 我对此表示怀疑。 headtail 似乎是过滤器(如 DOS 的 more 过滤器),而不是 DOS 命令。
  • @RobertHarvey 不一定是tail 命令,只是那个功能。

标签: windows windows-7 dos command-prompt


【解决方案1】:

一种选择是安装cygwin,它附带了所有基本的Unix命令行工具,如headtail

【讨论】:

    猜你喜欢
    • 2010-09-16
    • 2011-10-16
    • 2018-12-01
    • 1970-01-01
    • 2016-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多