I'm not exactly sure if I got what you mean, but.
Within a single shell session (terminal), you'd use a pipeline to pass data from one command to another, like so:
$ ls -l | grep something
If you need to do that between two different shells, you can use a named pipe:
tty1$ mkfifo /tmp/mypipe
tty1$ ls -l > /tmp/mypipe
tty2$ grep something < /tmp/mypipe
It would be safer to use mktemp
to create a directory to place the named pipe in:
tty1$ dir=$(mktemp -d)
tty1$ mkfifo "$dir/mypipe"
tty1$ ls -l > "$dir/mypipe"
tty1$ rm -r "$dir"
though that requires copying the path to the other window, possibly by hand.
Of course, a named pipe acts a bit like an intermediate file, in that it needs a path name. But it acts more like a pipe in that the data doesn't get written to permanent storage, and the reader waits for the writer if the writer is slow, instead of possibly encountering a premature end-of-file.
(You'd usually use ls -l *something*
instead of ls | grep
, but it works as an example.)