5 ms·
Neat. So when my terminal is spewing output because I ran "cat massivefile" instead of "cat massivefile | head", I can hit ctrl-D to stop it instead of repeated
by VintageCool 10y ago
Neat. So when my terminal is spewing output because I ran "cat massivefile" instead of "cat massivefile | head", I can hit ctrl-D to stop it instead of repeatedly hitting ctrl-C and despairing.
- gonvaled 10y agoI don't think so, since cat is reading from massivefile, not from your tty.
- rfw1z 10y agoNo, thats what ctrl-s and ctrl-q are for. Here's the rest in one place: eof VEOF EOF character eol VEOL EOL character eol2 VEOL2 EOL2 character erase VERASE ERASE character erase2 VERASE2 ERASE2 character werase VWERASE WERASE character intr VINTR INTR character kill VKILL KILL character quit VQUIT QUIT character susp VSUSP SUSP character start VSTART START character stop VSTOP STOP character dsusp VDSUSP DSUSP character lnext VLNEXT LNEXT character reprint VREPRINT REPRINT character status VSTATUS STATUS character cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>; eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;
- spudlyo 10y agoBack in the day, using a slow modem or teletype, discard (flush output) was super important, but several years back when I hooked up an actual Wyse dumb terminal to a Linux box I was dismayed to discover that it's actually not implemented in Linux.
- vram22 10y agoNice. Reminds me of using the "stty -a" and "stty <some_param>" commands many times on Unix terminals, back in the day, for some of those settings you list, also for things like CR/LF translation (ocrnl, onlcr, ...), raw, sane, ...
- amatai 10y agoAlso, a side note, I would rather just run "head massivefile" or even better "less massivefile" (because, most probably I'd want to see past what head shows by default). Running cat and then piping it to another program is inefficient, 2 forks + pipe.
- sigjuice 10y agoBut you miss out on this award if you don't use cat :p http://porkmail.org/era/unix/award.html http://porkmail.org/era/unix/award.html
- vram22 10y agoAnd on systems where head was not present (seen some earlier), but sed was, you could do: sed nq file where n is some positive integer, to print the first n lines of the file. Also, body (the complement of head and tail :) # body sed -n $1,$2p $3