1
0
I have a file contains many lines, like 1 million lines, and cat the_file
takes too much time to scroll.
$ time cat 1m
......
cat 1m 0.00s user 11.21s system 28% cpu 38.839 total
How to make it faster? Like xterm or urxvt's jumpScroll option?
I'm using PuTTY 0.62 and Windows 8 CP, If Windows 7 is necessary, I can change.
Here is the code I used to generate the file:
#include <stdio.h>
int
main(void) {
int i;
for (i = 2; i < 999999; i++) {
printf("%d\n", i);
}
return 0;
}
1Note that if you only want to see the last lines in a file the
tail
command is better thancat
ing the whole file to the terminal. – Dan D. – 2012-03-15T04:00:47.343@DanD, Thank you for let me realized that
tail
,more
, etc are more widely useful than my thoughts, I simple made easy things harder... It's time to change some of my command line using behaviors. However this questions continues, jumpScroll still is a very needed feature. – Mengdi Gao – 2012-03-15T05:14:59.567You haven't said what part of the file you want to see. I am assuming the end of the file? A specified line number? – serotonin – 2012-03-15T05:25:12.013
@serotonin I'm not meant to see the any part of the file, I want to
cat
or run a program which print 1 million lines to the stdout, and the PuTTY costs 38 seconds to finish this, so I ask if this can be faster. – Mengdi Gao – 2012-03-15T05:30:55.163