2013-01-03 116 views
0

可能重复:
Looking for a windows equivalent of the unix tail command
Windows equivalent of the 'tail' command* nix头部和尾部命令的Windows/DOS相当于什么?

我需要存储的第一个和最后100线极大的相(多千兆字节)的XML文件。在* nix上,我只会这样做:

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

我该如何从Windows/DOS命令提示符执行相同操作?

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

+1

http://stackoverflow.com/q/187587 –

+2

http://stackoverflow.com/q/1295068 –

+0

@RobertHarvey有没有什么办法让'tail'没有安装任何东西? – Matt

回答

1

一个选项是安装cygwin,它带有所有基本的Unix命令行工具,如headtail