Questions
Questions

FA25_ISOM_661_4102 Final exam (Cohort B)- Requires Respondus LockDown Browser

Multiple choice

You want to write a shell script that: Creates a directory called backup, if it doesn't already exist, and Copies all .txt files from the current directory into the backup directory.   Which of the following code snippets (if any) will achieve this?

Options
A.None of the other answers is correct
B.mkdir -p backup cp *.txt backup/
C.if [ ! -d "backup" ]; then   mkdir backup fi cp *.txt backup/
D.mkdir backup cp *.txt backup/
E.if [ -d "backup" ]; then   mkdir backup fi cp *.txt backup/
View Explanation

View Explanation

Verified Answer
Please login to view
Step-by-Step Analysis
First, let's restate the task and the options to ensure understanding of what's being evaluated. The goal is to create a directory named backup if it doesn't already exist, and then copy all .txt files from the current directory into that backup directory. Option A: None of the other answers is correct Option B: mkdir -p backup\ncp *.txt backup/ Option C: if [ ! -d "backup" ]; then\n mkdir backup\nfi\ncp *.txt backup/ Option D: mkdir ......Login to view full explanation

Log in for full answers

We've collected over 50,000 authentic exam questions and detailed explanations from around the globe. Log in now and get instant access to the answers!

More Practical Tools for Students Powered by AI Study Helper

Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!