Challenge - 5 Problems
Daily File Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why is file management important every day?
Which of the following best explains why file management is a daily task in Linux command line work?
Attempts:
2 left
💡 Hint
Think about how files accumulate and change over time.
✗ Incorrect
Files are created, modified, and deleted regularly. Managing them daily prevents clutter and data loss.
💻 Command Output
intermediate2:00remaining
Output of listing files after daily cleanup
What is the output of this command sequence after daily file cleanup?
Commands:
mkdir testdir
cd testdir
touch file1 file2 file3
rm file2
ls
Linux CLI
mkdir testdir cd testdir touch file1 file2 file3 rm file2 ls
Attempts:
2 left
💡 Hint
Check which file was removed before listing.
✗ Incorrect
The 'rm file2' command deletes file2, so only file1 and file3 remain.
📝 Syntax
advanced2:00remaining
Correct command to move files daily
Which command correctly moves all '.log' files from the current directory to a folder named 'logs' as part of daily file management?
Attempts:
2 left
💡 Hint
The 'mv' command moves files; check the order of arguments.
✗ Incorrect
'mv *.log logs/' moves all files ending with .log into the logs directory.
🔧 Debug
advanced2:00remaining
Why does this daily cleanup script fail?
This script is meant to delete all '.tmp' files daily but fails. Why?
Script:
rm *.tmp
mkdir tmp_files
mv *.tmp tmp_files/
Attempts:
2 left
💡 Hint
Think about the order of deleting and moving files.
✗ Incorrect
The script deletes all .tmp files first, so the move command has no files to move and fails.
🚀 Application
expert3:00remaining
Automate daily file archiving with a script
You want to create a daily script that archives all '.txt' files in the 'docs' folder into a zip file named with the current date (e.g., 2024-06-15.zip). Which script snippet correctly does this?
Attempts:
2 left
💡 Hint
Check the date format and argument order for the zip command.
✗ Incorrect
Option D uses the correct date format and places the zip file name first, then the files to archive.