exam questions

Exam 101-500 All Questions

View all questions & answers for the 101-500 exam

Exam 101-500 topic 1 question 44 discussion

Actual exam question from LPI's 101-500
Question #: 44
Topic #: 1
[All 101-500 Questions]

Given the following input stream:
txt1.txt
atxt.txt
txtB.txt
Which of the following regular expressions turns this input stream into the following output stream? txt1.bak.txt atxt.bak.txt txtB.bak.txt

  • A. s/^.txt/.bak/
  • B. s/txt/bak.txt/
  • C. s/txt$/bak.txt/
  • D. s/^txt$/.bak^/
  • E. s/[.txt]/.bak$1/
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
shyamite
Highly Voted 4 years, 4 months ago
correct \/ In my opinion the correct option is s / txt $ / bak.txt /
upvoted 20 times
...
cast7omadrid1
Highly Voted 4 years, 5 months ago
In my opinion the correct option is s / txt $ / bak.txt /
upvoted 13 times
...
Ninymo
Most Recent 3 months, 3 weeks ago
Answer: C
upvoted 1 times
...
blk_542
1 year, 8 months ago
Correct is C
upvoted 1 times
...
cloudbased
2 years, 1 month ago
Selected Answer: C
C because $ will change the only "txt" at the end of the line. If there is no $ symbol the command will change the first part of the name of the first file too.
upvoted 4 times
...
gonzaloco
2 years, 2 months ago
C 100%
upvoted 1 times
...
w3rr
2 years, 5 months ago
Selected Answer: C
answer is C
upvoted 2 times
...
saliente
2 years, 5 months ago
/var/root # cat teste | sed s/txt$/bak.txt/ txt1.bak.txt atxt.bak.txt txtb.bak.txt /var/root # cat teste | sed s/txt/bak.txt/ bak.txt1.txt abak.txt.txt bak.txtb.txt C is the right
upvoted 4 times
...
nedoex
2 years, 5 months ago
Selected Answer: C
aswer must be C
upvoted 2 times
...
serlan
2 years, 6 months ago
Selected Answer: C
answer is C
upvoted 2 times
...
anhcq
2 years, 8 months ago
sed s/txt$/bak.txt/ <<TXT > txt1.txt > atxt.txt > txtB.txt > TXT answer is C
upvoted 2 times
...
Nedyar
2 years, 9 months ago
text inside file: txt1.txt atxt.txt txtB.txt cat file | sed 's/txt/bak.txt/' bak.txt1.txt abak.txt.txt bak.txtB.txt I am doing something wrong?
upvoted 1 times
...
CuriousLinuxCat
2 years, 11 months ago
B makes the most sense to me. Adding the $ just unnecessarily complicates things.
upvoted 1 times
...
Thuhaib
3 years, 3 months ago
C is the Correct Answer
upvoted 4 times
...
RalfScholze
3 years, 4 months ago
s/txt$/bak.txt/ replaces the string txt with bak.txt at the end of the line. Globally is nonsense, since there is only one “txt at the end of the line” in any line. Memorize B for your test. After passing the test, forget B and realize that the answer C is the correct one. Life is tough.
upvoted 4 times
...
Rini_Giannenzo
3 years, 8 months ago
C check todoist
upvoted 3 times
...
basic88
3 years, 9 months ago
I think b is the correct answer. The only option that is missing is the g at the end. /txt/ wil search for exactly that word, and will change it to /bak.txt/,
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago