Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using the Linux command line tools, answer the following questions: Answer the f

ID: 3711398 • Letter: U

Question

Using the Linux command line tools, answer the following questions:

   Answer the following for EACH Nano, VI, EMACS:

       What key command saves a file?



       What key command exits the program?


       Write the following python code in each editor (with the appropriate name) and execute using the python3 command. Save each file as helloworld_editorname.py:

           print("Hello world from VI/EMACS/Nano")

       Post a screenshot of each script executing.



Do some research into the sed and awk commands. Write a 5+ sentence description of each:




Describe in your own words what a regular expression is.





Complete the 14 exercises located at regexone.com. Post screenshots of a matching regex for exercises 5, 7, and 14.


      

Explanation / Answer

What key command saves a file?

Answer:

To get into it, press Esc and then : (the colon). The cursor will go to the bottom of the screen at a colon prompt. Write your file by entering :w and quit by entering :q . You can combine these to save and exit by entering :wq

What key command exits the program?

To quit the vi editor without saving any changes you've made:

Do some research into the sed and awk commands. Write a 5+ sentence description of each:

Answer:

Sed commands:

SED command in UNIX is stands for stream editor and it can perform lot’s of function on file like, searching, find and replace, insertion or deletion. Though most common use of SED command in UNIX is for substitution or for find and replace. By using SED you can edit files even without opening it, which is much quicker way to find and replace something in file, than first opening that file in VI Editor and then changing it.

Syntax:

awk commands:

You can write awk scripts for complex operations or you can use awk from the command line. The name stands for Aho, Weinberger and Kernighan (yes, Brian Kernighan), the authors of the language, which was started in 1977, hence it shares the same Unix spirit as the other classic *nix utilities

The awk command is a powerful method for processing or analyzing text files—in particular, data files that are organized by lines (rows) and columns. Simple awk commands can be run from the command line. More complex tasks should be written as awk programs (so-called awk scripts) to a file

Describe in your own words what a regular expression is.

Answer:

Regular Expression:

A regular expression is a string that can be used to describe several sequences of characters. Regular expressions are used by several different Unix commands, including ed, sed, awk, grep, and to a more limited extent, vi.

Here SED stands for stream editor. This stream-oriented editor was created exclusively for executing scripts. Thus, all the input you feed into it passes through and goes to STDOUT and it does not change the input file

Regular expressions are special characters which help search data, matching complex patterns. Regular expressions are shortened as 'regexp' or 'regex'.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote