Question: Question1: What is a foreground process and a background process?? What are the roles of following commands? Test them and paste the example in the

Question1: What is a foreground process and a background process?? What are the roles of following commands? Test them and paste the example in the document.

  • ps
  • kill
  • fg
  • bg
  • &

PART-II

Using pipes in UNIX

Standard Input and output devices

Every programs normally have some input and some output. In other words, some data has to be entered and some kind of analysis will come out afterwards. The input to a program might come from a file, or might be typed in to the program by the user. The output might appear on the screen, be sent to a file or to a printer.

Programs for UNIX are usually written as though input is typed in by the user, and output appears on the screen.

PIPE & REDIRECTION:

The symbol | (vertical bar) is the Unix pipe symbol that is used on the command line.

> is used to redirect the output to a file

< is used to take input from a file

Try :

$cat > weather.txt

^z

To do:

  1. Run the command cat weather.txt | wc
  2. Explain the output
  3. Run the following command and explain its functioning

$ who > current_users

  1. Give an example each of pipes and redirection operators from your own understanding. (test it and show result)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!