Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Possible Duplicate:
Run a command for a specified time and then abort if time exceeds

Looked all over and I can't find the answer...

Simple question: How can I cat a large file for, lets say, 45 seconds and output it to the screen or redirect to another file.


share|improve this question

marked as duplicate by Michael Mrozek Feb 8 '12 at 20:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 3 down vote accepted

You could try:

timeout 45 cat yourfile

See also

share|improve this answer
timeout is cleaner and allows the duration option to be specified in seconds, minutes, hours, as well as the option to specify which signal to send. cleaner and more readable – bdowning Feb 8 '12 at 20:14

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