Question: (a) Explain the difference between UNIX/Linux ordinary pipe and named pipe (b) Run the following command and see what would be printed on your terminal:
(a) Explain the difference between UNIX/Linux ordinary pipe and named pipe (b) Run the following command and see what would be printed on your terminal: a. Scat unix-pipc.c wc Note: The cat command is used to display the contents of the unix-pipe.c file, but the display is not sent to the screen; it goes through a pipe to the we (word count) command. The we command then counts the lines, words, and characters of the contents of the file from the pipe. (c) Write a simple text file simple.txt that has three lines: Today Tuesday, Is tomorrow Wednesday2, next ycar Show what would be printed by a. b. i. S cat simple.txt sed -e "sext/this/g" ii. S cat simple.txt sed-e"g Note: The command line filter sed command changed every occurrence of the word "next" to the word "this" The sed took as input the data through the pipe. The sed command displayed its output to the terminal. It is important to note that, the contents of the simple.txt file itself were not changed. (d) Show what would be printed by a. cat simple.txt | awk-F = '{print $1 }. b. cat simple.txt awk -F print "next "$2" Note: The contents of the simple.txt are sent through a pipe to the awk filter command. The awk command displays the first word on each line that comes before the - sign. 14 The"" is the field delimiter. SI represents the first field. S2 represents the second fielod (e) Show what would be printed by a. cat simple.txt | grep next Note: The Unix/Linux grep filter command helps you search for strings in a file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
