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 8265221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:43:28+00:00 2026-06-08T04:43:28+00:00

Why do the following lines print only once the files in the current directory

  • 0

Why do the following lines print only once the files in the current directory (and not three times)?

This is a question from an exam. If you know some source to read about it, it will be great

cp /bin/ls blah
cat blah blah blah >bbb
chmod u+x bbb
bbb
  • 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-08T04:43:29+00:00Added an answer on June 8, 2026 at 4:43 am


    You would need something like:

    cp /bin/ls/blah .
    cat blah blah blah >bbb
    chmod u+x bbb
    ./bbb
    

    The first difference is the number of parameters to cp. You need to specify the destination as well as the source. The second difference is that unless you have the current directory in the path, you need to use ./command instead of just command to execute a program residing in the current directory.

    Besides that, it would important to know what is the content of /bin/ls/blah. If that file is a bash script containing something like:

    #!/bin/ls
    ls
    

    the modified block of code given at the beginning of this answer will work as expected (printing 3 times the contents of the current directory). If the file is a binary file, it most probably would not work, since you cannot concatenate binary files and expect the resulting file to behave as 3 sequential executions of the original binary file.

    UPDATE: After your edit, the answer clearly changes. Now, only the last part applies to it. Since /bin/ls is a binary file, you cannot concatenate binary files and expect the resulting file to behave as 3 sequential executions of the original binary file. If instead of a binary file you were using a script the example would work, though.

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

Sidebar

Related Questions

I have the following question. How can I print an output file line by
Encounter following lines of code, but couldn't understand it. What is this (/ ...
I'm trying to display the following code only once while the rest of the
When I run the following php code the while loop only runs once even
Alex's answer has the following line when translated to English print %2d. %8.2f %8.2f
The following lines work when I enter them by hand on the Scala REPL
I am using the following lines of code to download and save an html
I'm using the following lines of code in my .htaccess file to create redirects.
Consider the following lines of jQuery: var $s = $('<span><span class=one><span class=two></span></span></span>'); $('.one', $s).css('border',
I found the following lines in a makefile tutorial, but I have some problem

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.