Bird
0
0

How can you schedule multiple commands to run once at 10 PM using at?

hard📝 Application Q9 of 15
Linux CLI - Cron and Scheduling
How can you schedule multiple commands to run once at 10 PM using at?
Aat 22:00 "cd /tmp; ls -l"
Becho "cd /tmp; ls -l" | at 22:00
Cecho -e "cd /tmp\nls -l" | at 22:00
Dat 22:00; cd /tmp; ls -l
Step-by-Step Solution
Solution:
  1. Step 1: Understand how to pass multiple commands to at

    Multiple commands can be passed by echoing them separated by newlines and piping to at.
  2. Step 2: Evaluate options

    echo -e "cd /tmp\nls -l" | at 22:00 uses echo -e with newline escape to send two commands correctly. echo "cd /tmp; ls -l" | at 22:00 uses semicolon but without newline, which may work but is less reliable. The other options misuse syntax by passing commands as arguments or separating incorrectly.
  3. Final Answer:

    echo -e "cd /tmp\nls -l" | at 22:00 -> Option C
  4. Quick Check:

    Use newline-separated commands piped to at = B [OK]
Quick Trick: Use newline-separated commands piped into at [OK]
Common Mistakes:
  • Passing commands as arguments
  • Using semicolons without newline
  • Incorrect command chaining

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes