Skip to main content
edited body
Source Link
jippie
  • 14.6k
  • 10
  • 49
  • 67

Didn't try this myself, but how about this:

tar xvf archive.tar | tailhead -n50 

Tar outputs a line to STDOUT for each file extracted, then the tailhead command will kill the pipe after 50 lines. Upon the pipe dying, I'd expect the tar to die too.

Didn't try this myself, but how about this:

tar xvf archive.tar | tail -n50 

Tar outputs a line to STDOUT for each file extracted, then the tail command will kill the pipe after 50 lines. Upon the pipe dying, I'd expect the tar to die too.

Didn't try this myself, but how about this:

tar xvf archive.tar | head -n50 

Tar outputs a line to STDOUT for each file extracted, then the head command will kill the pipe after 50 lines. Upon the pipe dying, I'd expect the tar to die too.

Source Link
jippie
  • 14.6k
  • 10
  • 49
  • 67

Didn't try this myself, but how about this:

tar xvf archive.tar | tail -n50 

Tar outputs a line to STDOUT for each file extracted, then the tail command will kill the pipe after 50 lines. Upon the pipe dying, I'd expect the tar to die too.