exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 265 discussion

Actual exam question from CompTIA's XK0-005
Question #: 265
Topic #: 1
[All XK0-005 Questions]

A Linux administrator would like to run the cleanup script /home/admin/script.sh at 9:00 p.m. on March 31. Which of the following commands should the administrator use to accomplish this task?

  • A. at –f /home/admin/script.sh 9pm March 31
  • B. echo < /home/admin/script.sh | at 9pm March 31
  • C. at 9pm March 31 | echo > /home/admin/script.sh
  • D. at 9pm March 31 –f /home/admin/script.sh
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
lexdaniel
1 week, 1 day ago
Selected Answer: D
D. according to this site, we can also run scheduled tasks by passing a shell script file to the at command using the -f option. Let’s run a file at 00:00 (midnight): $ at 00:00 -f /home/ubuntu/file.sh https://www.baeldung.com/linux/at-command
upvoted 1 times
...
NastyNutsu
3 weeks, 4 days ago
Selected Answer: B
at [TIME] [DATE] A. -f is not a valid option for the at command B. echo < /home/admin/script.sh | at 9pm March 31 -- reading from the source and pipe it down the at command, make sense. C. does not work (you are writing into the source). D. same as A, -f is not a valid flag
upvoted 1 times
...
jimr999
1 month, 2 weeks ago
Selected Answer: A
I tested all four. A ran reliably (I used a bash script to output some text with the time of exection to a text file). B, C, and D produced no output to the text file. C and D did not work as one-liners (the command would be `at 9pm March 31` and it puts you at the at> prompt. Adding the remainer of the commands did not result in any output to the text file
upvoted 3 times
...
Bull88
2 months, 1 week ago
Selected Answer: B
the answers ABD are correct, perhaps because I am using lastest versions of Ubuntu and CentOS, but I will stick with the option B, very confusing tbh
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago