1

Possible Duplicate:
Looking for a windows equivalent of the unix tail command
Windows equivalent of the 'tail' command

I need to store the first and last 100 lines of a ginormous (multi-gigabyte) XML file. On *nix, I would simply do this:

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

How can I do the same from a Windows/DOS command prompt?

NOTE: I would prefer not to have to install anything.

6
  • 1
    stackoverflow.com/q/187587 Commented Jan 3, 2013 at 21:17
  • 2
    stackoverflow.com/q/1295068 Commented Jan 3, 2013 at 21:17
  • @RobertHarvey is there any way to get tail without installing anything?
    – Matt
    Commented Jan 3, 2013 at 21:21
  • I doubt it. head and tail appear to be filters (like DOS's more filter), not DOS commands. Commented Jan 3, 2013 at 21:21
  • @RobertHarvey not necessarily the tail command, just that functionality.
    – Matt
    Commented Jan 3, 2013 at 21:23

1 Answer 1

1

One option is to install cygwin, it comes with all the basic Unix command line tools like head and tail.

Not the answer you're looking for? Browse other questions tagged or ask your own question.