Which Linux command is used to display the first few lines of a file? MCQ with Answer and Explanation

Which Linux command is used to display the first few lines of a file?
A. tail
B. more
C. less
D. head
Answer: Option D
Solution (By JKSSB Mock Tests)
head shows the first 10 lines by default; tail shows the last lines.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Operating Systems Questions

Question #1
What is the purpose of the Linux 'nano' command?
A. To view system processes
B. To manage network interfaces
C. To set environment variables
D. A simple text editor

Correct Answer: Option D


Explanation:
nano is a user-friendly text editor for the command line, often pre-installed on many Linux distributions.

This question belongs to: Computer Operating Systems
Question #2
What type of file system structure records modifications to a storage drive in a dedicated log file before committing changes to track data corruption against crashes?
A. Compressed Allocation Mapping
B. FAT32 File System
C. Volatile Ramdisk Layout
D. Journaling File System

Correct Answer: Option D


Explanation:
Journaling file systems (like NTFS or ext4) track pending file changes in a dedicated journal log, allowing rapid structural recovery in the event of an abrupt power failure.

This question belongs to: Computer Operating Systems
Question #3
Which Linux command can be used to view the list of currently running processes for the active user?
A. cat
B. df
C. ls
D. ps

Correct Answer: Option D


Explanation:
The 'ps' command outputs a static snapshot list detailing active user or system processes running within the current environment configuration.

This question belongs to: Computer Operating Systems