Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just wondering; is it possible to skip the cat in

some_command | ssh remote 'cat > outputfile'

? It feels like a UUOC.

share|improve this question
It is a UUOC (useful use of cat). – Gilles May 21 '13 at 19:29
up vote 2 down vote accepted

No, you need something that reads its stdin and writes it to some file. cat is a good choice for that as it supports binary data and doesn't do anything fancy with its input so is small and efficient.

You could do:

... | ssh remote 'cp /dev/stdin outputfile`

But that would not be more efficient and would only work on systems that have /dev/stdin.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.