What is the function of the following UNIX command?
wc -l a > b &
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. It runs the word-count program to count the number of lines in its input, file a, writing the result to file b, but does it as a background process.
Explanation
wc -l a counts the number of lines in file a, and the > b redirects that count into file b — this much is common to options (i) and (ii). The deciding factor is the trailing &: in the shell, a trailing ampersand always launches the preceding command as a background job, returning control to the shell immediately rather than waiting for it to finish in the foreground. So the command counts a's lines into b while running in the background, matching option (ii), not the "foreground" claim in option (i). More System Software and Operating System questions
- Which of the following statements about the cron daemon in a UNIX operating system is NOT correct?
- In UNIX, which single command creates the directory "PIS" together with its two subdirectories "progs" and "data" (i.e. PIS/progs and PIS/d…
- Match List I with List II Choose the correct answer from the options given below:
- Match List I with List II Choose the correct answer from the options given below:
- Consider the following table about processes, their burst time and arrival time Now which of the process shall finish second last as per th…
- Which of the following statement is correct for Pthreads?