0% found this document useful (0 votes)
69 views

Lab Report - 6 - OS

This lab report summarizes experiments conducted using Linux pipes and file redirection commands. In the first question, the student used the rev command to reverse text output from echo and whoami, and observed that piping the output of cat produced no change. In the second question, the student piped the output of the ls --color command, which formats directory listings with colors, into cat and less, and noticed two differences in the output compared to directly viewing the ls listing. The experiments demonstrated how pipes transfer output between programs and how Linux commands can detect whether their output is going to the terminal or a pipe.

Uploaded by

Hafiz AB
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

Lab Report - 6 - OS

This lab report summarizes experiments conducted using Linux pipes and file redirection commands. In the first question, the student used the rev command to reverse text output from echo and whoami, and observed that piping the output of cat produced no change. In the second question, the student piped the output of the ls --color command, which formats directory listings with colors, into cat and less, and noticed two differences in the output compared to directly viewing the ls listing. The experiments demonstrated how pipes transfer output between programs and how Linux commands can detect whether their output is going to the terminal or a pipe.

Uploaded by

Hafiz AB
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

National University of Modern

Languages (NUML), Islamabad.

Lab Report – VI
Lab 7
Subject:
Operating System
Submitted To:
Sir Zain Ul Abideen
Submitted By:
Muhammad Fakhar Ali
Roll Number - 2085
Program & Semester:
BSCS & 5th (Evening)
Lab Exercise No.7
Question No.1:
a. Try the example on the ‘Pipes’ slide, using rev to reverse some text.
b. Try replacing the echo command with some other commands which produce output (e.g., whoami).
c. What happens when you replace rev with cat? You might like to try running cat with no arguments
and entering some text

Question No.2:
a. Run the command ls --color in a directory with a few files and directories. Some Linux distributions
have ls set up to always use the --color option in normal circumstances, but in this case we will give it
explicitly.
b. Try running the same command, but pipe the output into another program (e.g., cat or less). You
should spot two differences in the output. ls detects whether its output is going straight to a terminal
(to be viewed by a human directly) or into a pipe (to be read by another program).

You might also like