Less or More in Windows?
Is there a command in the Windows DOS prompt that is equivalent to the UNIX less
or more
?
Basically, the problem is that when I type hg log
, the output has too many lines to fit on the screen and I want to paginate it.
Any ideas on how to solve this problem?
Solution 1:
Windows has the command more
. E.g. (Taken from Wikipedia)
To display the file named letter.txt on the screen, the user can type either of the following two commands:
more < letter.txt
type letter.txt | more
So in your case you want hg log | more
.
For heavier usage you will want something like UnxUtils or GnuWin32, which have a more powerful less
utility.
.
Solution 2:
On Windows 10, you can install the Windows Subsystem for Linux:
The Windows Subsystem for Linux lets developers run Linux environments -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a virtual machine.
Once installed, start bash.exe
and run less /mnt/c/temp/test.txt
to open the file test.txt located in c:\temp.
Solution 3:
If you don't mind installing additional software gow is a nice toolkit with a set of standalone unix style tools that you can use, including less and more - it requires an install since it adds itself to path, but you can copy and use the install directory elsewhere as well.