Find the answer to your Linux question:
Results 1 to 3 of 3
Hi everyone, I have to execute some computations which produce a high amount of output. I want to redirect the output to some file. So I did ./script > output.txt ...
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    2

    grep and hard disk access

    Hi everyone,

    I have to execute some computations which produce a high amount of output. I want to redirect the output to some file. So I did

    ./script > output.txt

    Now the system administrator complaint that I produce too much hard disk accesses. So I changed my command to

    ./script | grep [some expression] > output.txt

    The expression that grep filters out is only about 10 lines. My question now is: Did I get it right that except the 10 lines, no hard disk access takes place? Or is it possible that the pipe involves some temporal storage of data on parts of the hard disk?

    And, is there some way to observe hard disk accesses as non-super user?

    Thank you,

    Lukul

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    Quote Originally Posted by Lukul View Post
    The expression that grep filters out is only about 10 lines. My question now is: Did I get it right that except the 10 lines, no hard disk access takes place? Or is it possible that the pipe involves some temporal storage of data on parts of the hard disk?
    No, in Linux pipes go through the kernel directly from one program to another. DOS used to have a pipe facility that involved one program creating a temporary file which the other program then read and deleted, but that was because DOS could only run one program at a time.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  3. #3
    Just Joined!
    Join Date
    Sep 2009
    Posts
    2
    Thank you. And good to know that thing about DOS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...