LX0-104 · Question #453
What command should be entered to print and then delete the file, foobar.txt?
The correct answer is C. lpr -r foobar.txt. The lpr command sends files to the printer spooler and includes an option to automatically remove the original file after it has been spooled.
Question
Options
- Alpr -0 delete foobar.txt
- Blpr -d foobar.txt
- Clpr -r foobar.txt
- Dlpr -0 remove foobar.txt
How the community answered
(45 responses)- A2% (1)
- B4% (2)
- C91% (41)
- D2% (1)
Why each option
The `lpr` command sends files to the printer spooler and includes an option to automatically remove the original file after it has been spooled.
The `-0` option is not typically used for file removal, and `delete` is not a valid option to remove the file after printing with `lpr`.
The `-d` option in `lpr` usually specifies the destination printer or class, not to delete the source file.
The `lpr -r foobar.txt` command sends `foobar.txt` to the print spooler and then automatically removes (deletes) the original file after it has been successfully spooled for printing.
The `-0` option is not used for file removal, and `remove` is not a recognized `lpr` option for this purpose.
Concept tested: LPR command options for file management
Source: https://www.cups.org/doc/man-lpr.html
Topics
Community Discussion
No community discussion yet for this question.