0
0
Linux CLIscripting~10 mins

at command for one-time jobs in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
Atomorrow 5pm
B17:00
Cnow + 1 hour
D5pm
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.
2fill in blank
medium

Complete 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'
A10:30 tomorrow
B10:30am tomorrow
Ctomorrow 10:30
Dnow + 1 day 10:30
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.
3fill in blank
hard

Fix 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'
Atomorrow 2am
B2am tomorrow
C2:00 tomorrow
D2am
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.
4fill in blank
hard

Fill 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'
Anow + 15 minutes
B-l
C-c
Dlist
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.
5fill in blank
hard

Fill 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'
A11:45pm
B$job_id
C1
Dnow + 1 hour
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.