Which command saves the output of the who command to user.lst while simultaneously printing it?
Show answer Hide answer
Answer: A. who | tee user.lst
Explanation
The tee command takes input from who and sends it simultaneously to a file and the screen. It acts like a plumbing T-junction, splitting the data stream into two identical output paths. This allows users to capture command output for logging while still viewing the results immediately. Pipeline operators allow the output of one command to become the input of another seamlessly. Standard output redirection typically sends results exclusively to a file or a terminal, but not both. Named after plumbing tee fittings, the tee utility solves the problem of dual-destination data streams.
System administrators use tee when recording diagnostic command outputs to audit log files during troubleshooting. Capturing installation logs while monitoring progress on screen ensures transparency during long setups. Mastering input and output redirection empowers users to build sophisticated command-line automation pipelines. Option who > user.lst saves output to the file but suppresses terminal display entirely. Option who >> user.lst appends output to the file without printing anything to the screen. Option who < user.lste attempts to use input redirection instead of output redirection, causing errors.
- Subject
- Computer Science
- Category
- Software Engineering
- Topic
- —
- Difficulty
- medium
Related questions
Q1. Which directory stores all user-created Aliases, including the user's login directory?
Show answer Hide answer
Answer: C. /usr
The /usr directory hierarchy contains user-related programs, shared libraries, and documentation across the system. It serves as a primary location for read-only user application data and software packages independent of...
Q2. Which command is used to calculate and report disk usage?
Show answer Hide answer
Answer: C. du
The du command summarizes disk usage for files and directory hierarchies. This utility calculates storage space consumed by specified directories and their contents. Administrators use this command to identify large fold...
Q3. Which file holds configuration data regarding password aging?
Show answer Hide answer
Answer: B. password
The password configuration file holds user account credentials and security aging parameters. It manages critical account lifecycle settings like maximum password validity durations and expiration warnings. System securi...
Q4. Which partition table format is supported by Linux?
Show answer Hide answer
Answer: D. DOS
Linux operating systems fully support the traditional DOS partition table format used by master boot record disks. Storage utility software can read, create, and modify DOS partition tables during disk partitioning opera...
Q5. Which command retrieves information regarding your own user session?
Show answer Hide answer
Answer: A. who am i
The who am i command displays information regarding the current active user session. This utility queries system accounting records to verify logged-in user details. Operators use this command to confirm their current te...
Q6. Which command copies file wb from the programs directory to wbx in the misc directory?
Show answer Hide answer
Answer: B. cp programs/wb misc/wbx
The cp command copies the source file to the specified destination path with a new filename. It duplicates the underlying data blocks while preserving the original source file intact. Specifying both source and target ar...