Are there incremental (interactive) utils shells? That is, "online" sorting, wc, etc.

Are there versions (replacements for replacement) of standard shells that display (partial) results updated on the fly (possibly for stderr)?

Say I want to do this:

du ~/* -s | sort -rn | head

At first, absolutely nothing happens before execution du. I would like to see partial results, i.e. I want to sortdisplay the data that he has already seen. That way, I can quickly see that something is wrong with the exit and fix it. For example, when running grep.

Same thing with this:

du ~/* -s | wc

I would like it to be updated on the fly.

Here is an ugly job showing what I want. (But preferably it should not unnecessarily consume the entire screen, for example, from dubelow.)

du ~/* -s > /tmp/duout | watch -n .1 sort -rn /tmp/duout

du ~/* -s > /tmp/duout | watch -n .1 wc /tmp/duout

, , :

du ~/* -s | isort -rn
+3
4

, . top.

, Linux. Sort , . - . , .

, . . :)

, , . , , Sort, . Sort , .

+4

tee /dev/tty . tee stdin, stdout, , . , :

du ~/* -s | tee /dev/tty | sort -rn | head

. ; , :

du ~/* -s | tee /dev/tty | sort -rn | less
+1

utils, . , . . grep, .

0

, 1 , ? , du -s ( , ). -s .

, . , : tee

du ~/* -s | tee /dev/tty | sort -rn | head

du ~/* -s | tee /dev/tty8 | sort -rn | tee /dev/tty12 | head

where tty8 and tty12 are separate terminal windows, and you find the correct ttyN to replace with ttyin the shell window.

Hope this helps.

PS as you, it seems, a new user, if you get an answer that helps you remember to mark it as accepted and / or give it + (or -) as a useful answer.

0
source

All Articles