
Bash Shell Scripting- sed: Viewing file content and deleting file content based on line numbers
Interactive Video
•
Information Technology (IT), Architecture
•
University
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Read more
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the basic syntax of the 'sed' command?
sed [options] [command] [file]
sed [options] [file] [command]
sed [file] [command] [options]
sed [command] [options] [file]
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you print all lines of a file using 'sed'?
sed -f 'p' [file]
sed -e 'p' [file]
sed -n 'p' [file]
sed '' [file]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the 'p' command do in 'sed'?
Inserts text
Deletes lines
Replaces text
Prints lines
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you print every third line starting from the first line using 'sed'?
sed '1-3p' [file]
sed '1+3p' [file]
sed '1,3p' [file]
sed '1~3p' [file]
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which command in 'sed' is used to delete lines?
a
p
d
s
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you delete lines from the 4th to the last line using 'sed'?
sed '4-$d' [file]
sed '4:$d' [file]
sed '4,$d' [file]
sed '4..$d' [file]
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the '-i' option do in 'sed'?
Modifies the original file
Prints lines
Inserts text
Deletes lines
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?