Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8974171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:37:19+00:00 2026-06-15T18:37:19+00:00

I guess I’m having a hard time understanding the differences. This is important because

  • 0

I guess I’m having a hard time understanding the differences. This is important because how would the user know what to type at the command line? At the command line, a.out file is for file processing where you need to explicitly open the file. a.out < file is redirected input and you don’t need to open the file. Pros and cons?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:37:21+00:00Added an answer on June 15, 2026 at 6:37 pm

    Stdin is particularly useful when you want to be able to pipe the output of one program to the input of another program, and so on in a chain, like this:

    cat myfile.txt | grep MyKeyword | wc -l
    

    (which will print out the number of lines in myfile.txt containing the string MyKeyword)

    If the “grep” and “wc” utilities were set up to only read from a specified file, rather than from stdin, the above task would be more difficult; you’d have to do it in multiple steps instead:

    grep MyKeyword myfile.txt > temp.txt
    wc -l temp.txt
    rm temp.txt
    

    … which would be awkward and also requires writing a temporary file to the disk, which can be problematic (e.g. what if there was already a temp.txt file in the current directory? Oops, you just overwrote it, too bad! Or what if you don’t have write-access to the drive? No way to write out a temporary file then)

    On the other hand, sometimes your program needs to read from more than one file. For example, if you wanted to concatenate several files together you can do this:

    cat part1.txt part2.txt part3.txt > wholething.txt

    If “cat” only supported reading from stdin it would be difficult to do such a thing, as you’d need some way to pipe multiple files into cat’s stdin stream.

    Also, if a program needed to read the file in non-linear order (e.g. fseek() forward or back in the file rather than just reading it straight through) it wouldn’t be able to do that using stdin, since you can’t seek on a pipe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I guess I'm a quick typer because if I type the characters ArrayList myArray;
I guess I haven't really had to do this much before because I am
I guess it's not so hard to do this by hand, but I was
I guess this question has been asked a lot around. I know Rails can
I guess I'm getting this error because the string is trying to substring a
I guess that the difficult part is the source. Do you know any webpage
I guess the problem is that I do not know how to use factory
I guess my main question is, will this always work as long as I
I guess this is a simple question. I need to do something like this:
Guess this is pretty simple, but searching didn't help... I want an ExpandableListView, where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.