Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 8
    Or ls | xargs -I {} echo {} if you want it to be called for each line individually Commented Aug 25, 2014 at 8:25
  • @AlexAbdugafarov why do you say "line"? I think it is supposed to be "file/directory" instead. Also if there are spaces in either file or directory, this is not going to get you the correct output. It should be ls | xargs -0 -I {} echo {}
    – Eugene
    Commented Jul 27, 2022 at 8:39