Question

5. Which command below deletes lines which has only letters? a. sed /[a-Z]*$/d file b.sed [a-Z]+S/d file c. sed IMa-zA-Z]*$/d file d. sed /[a-zA-Z]*$/ d file e. None of above

0 0
Add a comment Improve this question Transcribed image text
Answer #1

answer is option c.

sed '/[a-zA-Z]*$/d' file

The alternative of the above command is

sed -i '/[a-z]*$/d' file .

the above command takes -i for ignoring the case.

sed is a command used for replacing/deleting lines in a file.

we write the input(what to delete/replace ) in ( between two slashes : '/ /')

after the slash d is for deleting.

for replacing we use r.

In the out of given the suitable answer is option c.

^ indiacates the begining of the line.$ Indicates the end of the line.In between begining and ending the line we need to delete the alphabets .So we write '[^a-zA-Z]$' and slash(/) is used for sed command and d option for deleting the matched pattern.

Add a comment
Know the answer?
Add Answer to:
5. Which command below deletes lines which has only letters? a. sed '/[a-Z]*$/d' file b.sed [a-Z]+S/d'...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1) Which sed command line string will delete any line that begins with the string 'directory'...

    1) Which sed command line string will delete any line that begins with the string 'directory' within the file called sedfile. A) sed '/dir/d' sedfile B) sed '/^dir/d' sedfile C) sed 's/^dir/d' sedfile D) sed '/directory/d' sedfile 2) Complete the sed commmand string below. Create a sed command line string that will replace ALL the occurrences of X and x with s within the file called sedfile. sed 's/##/s/g' sedfile Replace the ## with the BEST correct answer. A) [X,x]...

  • Write a c program that takes in a text file and writes lines with only lowercase...

    Write a c program that takes in a text file and writes lines with only lowercase letters to another text file which is disclosed from the command line. If no text file to output to is disclosed in the command line, the lines with only lowercase letters should be written into a text file called "all_lower.txt"

  • hadoop command below: hadoop jar ~/hadoop-2.6.4/hadoop-streaming-2.6.4.jar -D stream.map.output.field.separator="sed -ie s/|/~/g" -input /user/FinalData/part.sample.tbl -output /user/FinalData/output part.sample.tbl= dataset...

    hadoop command below: hadoop jar ~/hadoop-2.6.4/hadoop-streaming-2.6.4.jar -D stream.map.output.field.separator="sed -ie s/|/~/g" -input /user/FinalData/part.sample.tbl -output /user/FinalData/output part.sample.tbl= dataset {198|khaki papaya|MFGR#3|MFGR#33|MFGR#338|orange|PROMO BRUSHED NICKEL|43|SM PACK| 16406 199|slate lace|MFGR#1|MFGR#13|MFGR#136|royal|ECONOMY PLATED STEEL|23|JUMBO DRUM| 16487 200|mint navajo|MFGR#2|MFGR#22|MFGR#2227|burnished|MEDIUM POLISHED BRASS|22|LG PKG|} after running the above hadoop command we should get the following delimiter (~) tida in the file 198~khaki papaya~MFGR#3~MFGR#33~MFGR#338|orange~PROMO BRUSHED NICKEL~43~SM PACK~ I am not getting tida (~) in my file. Again, the above command is a hadoop command.

  • used Linss file systems d FAT nd NTFS NTFS and est3 h ReiserFS and ext3 15....

    used Linss file systems d FAT nd NTFS NTFS and est3 h ReiserFS and ext3 15. A fie a hem ppicaly you might possibly sreae entries for all the ie than enongheir that file sy stemtains ore than enough 16. To create a syesbolic link, use the a. In command h In command with the -s optiorn d. symlink command You can learn numerous details about any file using the 17 s brip2 and buenion etitities in Linux? d. gzip...

  • Y(z) c(t), C(s) r(t), R(S) + - et), E(S) E*(s), Ez To- D(z) G (s) =...

    Y(z) c(t), C(s) r(t), R(S) + - et), E(S) E*(s), Ez To- D(z) G (s) = (1-e-STºys H(s) 32. If the system above has Y(z)R(z)= 1+z), and if the input is the unit step r(t)=u(t), then the signal y[n]= u[n]-e-Tou[n-1) | u[n]+u[n-1] a) c) u[n] + u[n-1) d) none above 33. If the system above has Y(z)/R(z)= 1+z), the dc gain of the system is C(z)/R(z)= b) 1/2 c)2 d) none above a) o 34. If the system above has...

  • QUESTION 1 From YOUR home directory, execute a find command string that will locate the file...

    QUESTION 1 From YOUR home directory, execute a find command string that will locate the file called resolv.conf. Include the -exec flag in the find command to cat the file to the screen. Begin your find search from the letc directory Select the correct find command string below that will accomplish this. find /etc-name 'resolv.conf -cat D find /etc-name 'resolv.conf -exec cat 0 find. -name 'resolv.conf -exec cat 0\ find /-name 'resolv.conf' -exec cat 0 QUESTION 2 What find command...

  • Write a python program that writes to an output file "decoder.txt" a table of letters as...

    Write a python program that writes to an output file "decoder.txt" a table of letters as follows: ___1_2_3_4_5 1: A B C D E 2: F G H I K 3: L M N O P 4: Q R S T U 5: V W X Y Z Note that the letter J has been removed. Use string.ascii_uppercase to start

  • USING PYTHON PLEASE 5. Consider a text file in which the only characters that appear are...

    USING PYTHON PLEASE 5. Consider a text file in which the only characters that appear are the letters "A", "B", "C", and "D" with the distribution 17%, 35%, 26%, and 22%, respectively. (To clarify, this means that 17% of the characters in the file are the letter "A", 35% are the letter "B", etc.) Using the technique demonstrated in class, construct the Huffman tree for this file (and don't forget to label the edges with 0 or 1 such that...

  • Which command(s) can be used to view VLAN membership for all VLANs on the switch? A....

    Which command(s) can be used to view VLAN membership for all VLANs on the switch? A. show vlan brief B. show membership vlan C. show running-config D. None of the above

  • 5. Which of the following can be used to determine whether the employ.txt file exists? a....

    5. Which of the following can be used to determine whether the employ.txt file exists? a. If Io. File.Exists("employ.txt") Then b. If Io. File("employ.txt").Exists Then C. If IO. Exists("employ.txt") = True Then d. If Io. Exists. File("employ.txt") = True Then 6. What type of object is created by the OpenText method? a. File c. StreamWriter b. SequenceReader d. None of the above. 7. What type of object is created by the AppendText method? a. File C. StreamWriter b. SequenceReader d....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT