Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to schedule a command to run at 5 PM today using the at command.
Linux CLI
echo "ls -l" | at "[1]"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '17:00' might not work as expected in all shells.
Using 'now + 1 hour' schedules the job one hour from now, not at 5 PM.
Using 'tomorrow 5pm' schedules the job for tomorrow, not today.
✗ Incorrect
The
at command accepts time in formats like '5pm' to schedule jobs for that time today.2fill in blank
mediumComplete the code to schedule a script backup.sh to run at 10:30 AM tomorrow.
Linux CLI
at "[1]" -f backup.sh
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'tomorrow 10:30' might not be recognized correctly.
Using 'now + 1 day 10:30' is not a valid
at time format.Using '10:30 tomorrow' misses the AM/PM and may cause errors.
✗ Incorrect
The
at command accepts '10:30am tomorrow' to schedule a job at 10:30 AM the next day.3fill in blank
hardFix the error in the command to schedule echo Hello to run at 2 AM tomorrow.
Linux CLI
echo "echo Hello" | at "[1]"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '2am' alone schedules the job for 2 AM today if that time is in the future.
Using '2:00 tomorrow' is not a valid
at time format.Using '2am tomorrow' may cause errors depending on shell parsing.
✗ Incorrect
The correct format is 'tomorrow 2am' to specify 2 AM the next day for the
at command.4fill in blank
hardFill both blanks to schedule a command to run 15 minutes from now and list all scheduled jobs.
Linux CLI
echo "date" | at "[1]" && at [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' instead of '-l' to list jobs causes errors.
Using 'now + 15' without 'minutes' schedules immediately or errors.
Using '-c' lists job contents but is not the standard list command.
✗ Incorrect
Use 'now + 15 minutes' to schedule the job 15 minutes later, and 'at -l' to list all scheduled jobs.
5fill in blank
hardFill both blanks to schedule a job to run a script cleanup.sh at 11:45 PM today, then remove the job by its ID.
Linux CLI
at "[1]" -f cleanup.sh job_id=$(atq | head -n 1 | cut -f1) atrm [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1' to remove the job may delete the wrong job.
Using 'now + 1 hour' schedules the job at the wrong time.
Not capturing the job ID before removing causes errors.
✗ Incorrect
Schedule the job at '11:45pm' today, then remove it using the job ID stored in the variable
job_id.