Mastering the sed Command in Linux

Mastering the sed Command in Linux

12th Grade

15 Qs

quiz-placeholder

Similar activities

My First HTML

My First HTML

9th - 12th Grade

15 Qs

12 CS 10-16

12 CS 10-16

12th Grade

15 Qs

G10_Quiz_1_2t_2024

G10_Quiz_1_2t_2024

12th Grade

20 Qs

Latihan Corel Draw

Latihan Corel Draw

12th Grade

10 Qs

Presentation Quiz

Presentation Quiz

9th - 12th Grade

10 Qs

CFU 3.3 - File Extensions

CFU 3.3 - File Extensions

9th - 12th Grade

19 Qs

FMT web developing session 4 HTML5 + CSS3

FMT web developing session 4 HTML5 + CSS3

KG - Professional Development

15 Qs

Mastering the sed Command in Linux

Mastering the sed Command in Linux

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Leyla Zeynallı-Hüseynzadə

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the basic syntax of the sed command?

sed [options] 'input-file' 'script'

sed [options] 'script' [input-file]

sed [input-file] 'script'

sed 'script' [input-file] [options]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you perform substitution in a string using sed?

sed 's/pattern/replacement/' filename

sed 's/pattern/replacement/g' filename

sed 'r pattern/replacement/' filename

sed 's/replacement/pattern/' filename

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which sed command is used to delete a specific line from a file?

sed -i 'Nd' filename

sed -n 'Nd' filename

sed 'N!d' filename

sed -e 'Nd' filename

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you insert text before a specific line using sed?

sed '3s/^/text to insert /' filename

sed '3c ext to insert' filename

sed '3i\text to insert' filename

sed '3a ext to insert' filename

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 's' command in sed?

The 's' command formats output for display.

The 's' command is for searching text.

The 's' command is used for deleting lines.

The 's' command in sed is for substitution.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you use sed to delete all blank lines in a file?

sed -e '/^$/d' filename

sed -n '/./p' filename

sed -i '/^$/d' filename

sed -i '/^/d' filename

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the command to replace 'foo' with 'bar' in a file using sed?

sed 's/foo/bar/' filename

sed -i 's/foo/bar/g' filename

sed -i 's/bar/foo/g' filename

sed -e 's/foo/bar/g' filename

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?