Unix command lines. A) Assume that your current working directory is NOT the same as your home...

70.2K

Verified Solution

Question

Programming

Unix command lines.

A) Assume that your current working directory is NOT the same asyour home directory. Print all file and subdirectory names of yourhome directory into a file named file2.

B) Copy the text from line 11 to line 20 of a given fileinput.txt and append the copied text at the end of the fileoutput.txt. (Assume that the file input.txt contains more than 20lines of text contents)

C) Count and display the total number of words in ALL files inthe current working directory whose name end with “.txt”

D) Count the number of lines where the word “foo” appears in agiven file bar.txt

Answer & Explanation Solved by verified expert
3.9 Ratings (668 Votes)
A Command ls l filestxt and find ls file2txt Explanation ls command is used to list all the files in the directory l option provides one to give all the information is used as redirection operator all the output generated previously is stored in the given filestxt B Command sed n e 1120p inputtxt outputtxt Explanation Sed is a powerful text stream editor One can do    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students