LFCS · 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. To print a file and then automatically delete it after it has been spooled, the lpr command with the -r option is used.
Question
Options
- Alpr -0 delete foobar.txt
- Blpr -d foobar.txt
- Clpr -r foobar.txt
- Dlpr -0 remove foobar.txt
How the community answered
(38 responses)- A3% (1)
- B3% (1)
- C89% (34)
- D5% (2)
Why each option
To print a file and then automatically delete it after it has been spooled, the `lpr` command with the `-r` option is used.
`-0 delete` is not a valid or standard option for the `lpr` command to remove a file after printing.
The `-d` option in `lpr` is typically used to specify a destination printer, not to delete the file.
The `lpr -r` command prints the specified file and then automatically removes (deletes) it from the file system after the print job has been successfully spooled. This is useful for temporary files or sensitive documents that shouldn't persist on the disk after printing.
`-0 remove` is not a valid or standard option for the `lpr` command to remove a file after printing.
Concept tested: `lpr` command options for file handling
Source: https://www.cups.org/doc/man-lpr.html
Topics
Community Discussion
No community discussion yet for this question.