Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm looking for a unix command that is the opposite of cat (but not tac).

I want to do

$ SOMECOMMAND /tmp/file
I type some content
for the file here
^D
$ cat /tmp/file
I type some content
for the file here
$

So, I actually type in 'I type some content...' after running the command, and it is written to the file. And before you suggest it, yes, I am very aware of editors -- just looking for something shorthand.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

The opposite of cat is cat.

$ cat > /tmp/file
I type some content
for the file here
^D
$ cat /tmp/file
I type some content
for the file here
$
share|improve this answer
    
HA! I Love it. Will accept as soon as the 15 min are up. –  John Hinnegan Jun 14 '11 at 16:14

Your Answer

 
discard

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.