Search Header Logo

Lab 3 Quiz

Authored by Priyanka S Shivaramaiah

Professional Development

University

Used 8+ times

Lab 3 Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the command ls > capture.txt do?

Lists files on the terminal

Saves the list of files in capture.txt

Displays an error message in capture.txt

Combines output with stderr

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the command ./error.sh 1> capture.txt 2> error.txt, what is the purpose of 1>?

Redirects both stdout and stderr

Redirects standard output to capture.txt

Displays output in the terminal

Ignores standard output

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of running ./error.sh > /dev/null 2> /dev/null?

Only stdout is shown on the terminal

Both stdout and stderr are discarded

Only stderr is redirected to the terminal

The script fails silently

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you redirect the output of ls to a file named capture.txt?

ls >> capture.txt

ls = capture.txt

ls > capture.txt

ls | capture.txt

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does chmod +x error.sh do?

Changes file ownership

Adds read permissions

Makes the file executable

Deletes the file

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens when you run ./error.sh > capture.txt?

The script runs without output

The output goes to capture.txt

The script fails to run

The terminal shows an error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of 2> in the command ./error.sh 2> capture.txt?

Redirects stdout

Redirects stderr

Displays output on the screen

None of the above

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?