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

  • SEARCH
  • Home
  • 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 7911875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:24:43+00:00 2026-06-03T13:24:43+00:00

everyone, i found this strange problem ( maybe it is a feature ) this

  • 0

everyone, i found this strange problem ( maybe it is a feature ) this afternoon.
In my current working directory, there are 5 files, namely a,b,c,d,e

If i issue the following command

echo "a" | ls -l

What I expect is only the detailed information of file a is listed.
But from the output, the detailed information of file a,b,c,d,e are listed.
It seems as if the command before the pipe is not working, eg, the following command will output exactly as if only ls -l is executed.

echo "whatever_you_type" | ls -l

I am confused, can anybody help to explain this issue?
I know i can workaround this problem by using xargs, something like echo "a" | xargs ls -l
But I want to know why.

  • 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-03T13:24:45+00:00Added an answer on June 3, 2026 at 1:24 pm

    When you pipe something into another process, it will be pushed into its STDIN stream. As ls does not read from stdin, it just ignores that. What you want is that the parameters are passed to the command line of ls. This can be achieved by using something like this:

    my_file="a"
    ls -l "$my_file"
    

    Alternatively, you can use xargs which can be used to construct command line parameters from stdin input. In your case, you could use it like

    echo "a" | xargs ls -l
    

    It will execute an ls -l [filename] for each space-separated string of stdin input.

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

Sidebar

Related Questions

Hi everyone I found this is working. Bundle parameters = new Bundle(); parameters.putString(message, This
Good day, everyone. I found strange behavior within ASP.NET engine when it handles non-existent
Update : I edited the code, but the problem persists... Hi everyone, this is
hello everyone I found this function in Kernel of the Linux: inline task_t *context_switch(task_t
Hello everyone I try to solve asterisk tree problem and found my code is
This may sound strange but sometimes when your ASP.NET webapp isn't working and you
It seems like everyone has found this without trouble. I do not see an
Everyone knows that there is cache in session. This cache generally could be cleared
Okay everyone, I have found multiple ways of doing this and I have even
Hi everyone I was using the jQuery form plugin to process form submission (found

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.