Linux questions often mix IPC concepts with short shell commands. One wrong assumption about pipe direction, option flags or signal behaviour can spoil an otherwise familiar problem. Classify IPC models, decode signals and network tools, trace command pipelines, and apply Unix permissions and shell parameters. Choose an option and write one line of reasoning before reading each explanation.
The IPC & Networking practice area has about 20 questions. Question 2 uses the IPC & Networking practice module because no individual solved page is available; the GATE CS Exam Preparation category places Linux IPC in the wider syllabus.
Linux IPC and networking concepts to use before the MCQs
Concept | Exam-ready meaning |
|---|---|
Shared memory | A common region requiring synchronisation. |
Message passing | Explicit send and receive operations. |
Unnamed pipe | A kernel-buffered, usually unidirectional byte stream. Data is consumed in FIFO order. |
Shell pipeline | Left-side standard output becomes right-side standard input. |
Signal | An asynchronous process notification. |
|
|
Trace printf 'alpha\nbeta\nalpha\n' | grep -v 'alpha' | wc -l. The shell connects three processes with two pipes. printf writes 17 bytes: 6 for alpha\n, 5 for beta\n, and 6 for alpha\n. grep -v removes both alpha lines and emits beta\n, or 5 bytes. One newline remains, so wc -l prints 1. A pipe preserves byte order, not application-level message boundaries.
For permissions, chmod 754 demo.sh gives the owner rwx, group r-x, and others r--. The values are read 4, write 2 and execute 1.
Linux IPC MCQs 1-3: communication models and pipes
Question 1 (UGC NET 2019, December)
Which of the following interprocess communication model is used to exchange messages among co-operative processes?
A. Shared memory model
B. Message passing model
C. Shared memory and message passing model
D. Queues
Correct answer: C. Shared memory and message passing model.
Shared memory uses a common region; message passing uses send and receive. A queue is only one mechanism, so C includes both standard IPC models.
Question 2 (CDAC CCAT 2019)
Pipes used for IPC behave like which data structure?
A. Stacks
B. Queue
C. Tree
D. Linked List
Correct answer: B. Queue.
A pipe returns bytes in FIFO order, matching a queue rather than the alternatives. It remains a byte stream without automatic message boundaries.
Question 3 (UGC NET 2019, June)
Which of the following UNIX/Linux pipes will count the number of lines in all the files having .c and .h as their extension in the current working directory?
A. cat *.ch | wc -l
B. cat *.[c-h] | wc -l
C. cat *.[ch] | ls -l
D. cat *.[ch] | wc -l
Correct answer: D. cat *.[ch] | wc -l.
The glob *.[ch] matches names ending in .c or .h. cat combines their contents and wc -l counts newline-terminated lines, so D is the intended command. A matches .ch, B treats c-h as a character range, and C sends the data to ls instead of wc.
If process creation itself needs revision, continue with Threads & Process Creation MCQs (GATE OS).
Linux signals and networking MCQs 4-5
Question 4 (UGC NET 2016, June)
Which of the following option with reference to UNIX operating system is not correct ?
A. INT signal is sent by the terminal driver when one types and it is a request to terminate the current operation.
B. TERM is a request to terminate execution completely. The receiving process will clean up its state and exit.
C. QUIT is similar to TERM, except that it defaults to producing a core dump if not caught.
D. KILL is a blockable signal.
Correct answer: D. KILL is a blockable signal.
SIGKILL cannot be caught, ignored or blocked, so D is incorrect. SIGTERM permits cleanup; terminals commonly generate SIGINT and SIGQUIT, with varying key mappings.
Question 5 (IBPS 2023)
Which of the following commands in Linux is primarily used for network scanning and security auditing?
A. netset
B. tcpdump
C. ifconfig
D. nmap
E. traceroute
Correct answer: D. nmap.
nmap discovers hosts, ports and services. tcpdump captures packets, ifconfig handles interfaces, and traceroute shows hops. netset is not the described standard tool.
Communication is only half the story. Process Sync MCQs: 12 Solved (GATE) practises safe ordering and shared-state access, while signals and pipes communicate or notify.
Linux command-pipeline MCQs 6-8: head, grep, sort and tr
Question 6 (UGC NET 2017, January)
Unix command to change the case of first three lines of file “shortlist” from lower to upper
A. tr '[a-z]' '[A-Z]' shortlist | head -3
B. head -3 shortlist | tr '[a-z]' '[A-Z]'
C. tr head -3 shortlist '[A-Z]' '[a-z]'
D. tr shortlist head -3 '[a-z]' '[A-Z]'
Correct answer: B. head -3 shortlist | tr '[a-z]' '[A-Z]'.
Order decides: head -3 shortlist emits lines 1 to 3, then tr '[a-z]' '[A-Z]' converts them. A wrongly passes the file to tr first.
Question 7 (UGC NET 2016, August)
Consider the following operations to be performed in Unix :“The pipe sorts all files in the current directory modified in the month of “June” by order of size and prints them to the terminal screen. The sort option skips ten fields then sorts the lines in numeric order.”Which of the following Unix command will perform above set of operations ?
A. ls -l | grep 'June' | sort +10n
B. ls -l | grep 'June' | sort +10r
C. ls -l | grep -v 'June' | sort +10n
D. ls -l | grep -n 'June' | sort +10x
Correct answer: A. ls -l | grep 'June' | sort +10n.
A is the expected source answer because it keeps the June lines and uses the only numeric sort option. The stem is technically inconsistent: in ordinary ls -l output, the size field appears before the month, so sort +10n does not reliably sort by file size. In practice, use a date-aware find command for the target June, emit each file size, and pass those records to sort -n.
Question 8 (UGC NET 2015, June)
What does
grep -vn "abc" xdo?
A. It will print all of the lines in the file x that match the search string "abc"
B. It will print all of the lines in file x that do not match the search string "abc"
C. It will print the total number of lines in the file x that match the search string "abc"
D. It will print the specific line numbers of the file x in which there is a match for string "abc"
Correct answer: B. It will print all of the lines in file x that do not match the search string "abc".
-v excludes lines containing abc; -n prefixes retained lines with numbers. B captures the result. A and D match lines; C would require -c.
Linux administration MCQs 9-10: permissions and cron
Question 9 (UGC NET 2017, November)
Consider the following statements:
(a) UNIX provides three types of permissions: Read, Write, Execute.
(b) UNIX provides three sets of permissions: permission for owner, permission for group, permission for others.
Which of the above statement/s is/are true?
A. Only (a)
B. Only (b)
C. Both (a) and (b)
D. Neither (a) nor (b)
Correct answer: C. Both (a) and (b).
Unix applies read, write and execute across owner, group and others. In 754, 7 = rwx, 5 = r-x, and 4 = r--, so both statements hold.
Question 10 (UGC NET 2016, June)
Which of the following statement is not correct with reference to cron daemon in UNIX O.S. ?
A. The cron daemon is the standard tool for running commands on a pre-determined schedule.
B. It starts when the system boots and runs as long as the system is up.
C. Cron reads configuration files that contain list of command lines and the times at which they invoked.
D. Crontab for individual users are not stored.
Correct answer: D. Crontab for individual users are not stored.
Users can have stored crontabs, so D is false. 15 6 * * 1-5 /usr/local/bin/backup requests 06:15, Monday to Friday. Storage paths vary.
Linux shell MCQs 11-12: special parameters and sequences
Question 11 (UGC NET 2014, June)
Match the following with reference to Unix shell scripts:
List I – List II
a. $? – i. File name of the current script
b. $# – ii. List of arguments
c. $0 – iii. The number of arguments
d. $* – iv. Exit status of last command
Codes:
A. a-iii, b-ii, c-i, d-iv
B. a-ii, b-iii, c-i, d-iv
C. a-iv, b-iii, c-i, d-ii
D. a-i, b-iii, c-i, d-iv
Correct answer: C. a-iv, b-iii, c-i, d-ii.
$? is the last exit status, $# the argument count, $0 the script name, and $* the positional arguments. The mapping gives C.
Question 12 (UGC NET 2014, June)
What output does
seq 1 2 10generate?
A. 1 2 10
B. 1 2 3 4 5 6 7 8 9 10
C. 1 3 5 7 9
D. 1 5 10
Correct answer: C. 1 3 5 7 9.
seq 1 2 10 starts at 1, adds 2 and stops before exceeding 10. It yields 1, 3, 5, 7, 9, so C is correct.
Linux IPC and networking MCQs: the short version and next step
Distinguish shared memory from message passing.
Read every pipeline from left to right.
Remember that pipes are FIFO byte streams.
Separate
SIGKILLfrom catchable signals.Decode every flag before choosing a command's output.
These questions favour classification, tracing and one-step elimination. Re-attempt all 12, then write the command pipeline's output by hand.
For Operating Systems in a complete GATE CS sequence, use GATE Guidance by Sanchit Sir. For Linux-only practice, continue in the IPC & Networking practice module.




