Question

In: Computer Science

Unix / Linux 6. vi editor: In vi command mode, what are the keystrokes you would...

Unix / Linux

6.

vi editor: In vi command mode, what are the keystrokes you would type to...

Quit the vi editor and save any changes?

7.

C language source files, by convention, have the suffix ".c".

The associated "header" files have the suffix ".h".

What is the command to perform the following task:

List all the C source and C header files in the current directory. [Hidden files may remain hidden.]

8.

C language source files, by convention, have the suffix ".c".

The associated "header" files have the suffix ".h".

What is the command to perform the following task:

Using the command from the previous question, assign the list of filenames to a shell variable named $list.

9.

What is the command to perform the following task:

Display the filenames from the shell variable $list that begin with a lower case vowel.

10.

Globbing (filename substitution):

Provide an argument to the ls command that will result in a globbing expression that meets the following description:

Filenames that contain a digit. [At least one digit]

Solutions

Expert Solution

Question 6

vi editor: In vi command mode, what are the keystrokes you would type to...

Quit the vi editor and save any changes?

Open the file using VI

go to Command mode by pressing "ESC" Key

:Shift+zz - Save the file and quit

:wq - Save the file and quit

Question 7

C language source files, by convention, have the suffix ".c".

The associated "header" files have the suffix ".h".

What is the command to perform the following task:

List all the C source and C header files in the current directory. [Hidden files may remain hidden.]

ls - l *.c *.h

ls - l command lists the file details in long format in the current directory.

Question 8

C language source files, by convention, have the suffix ".c".

The associated "header" files have the suffix ".h".

What is the command to perform the following task:

Using the command from the previous question, assign the list of filenames to a shell variable named $list.

Slist=ls *.c *.h

The above command will store the lists of files into a shell variable "Slist"

Question 9

What is the command to perform the following task:

Display the filenames from the shell variable $list that begin with a lower case vowel.

echo $Slist | grep -i '[aeiou]'   

Question 10

Globbing (filename substitution):

Provide an argument to the ls command that will result in a globbing expression that meets the following description:

Filenames that contain a digit. [At least one digit]

echo $Slist | grep -i *[0-9]*


Related Solutions

unix/Linux Create a tar command using the man command and the link referred to in To...
unix/Linux Create a tar command using the man command and the link referred to in To Practice and Explore: Text File Utilities #9. Preliminaries Use the man pages to learn more about tar Review the links referred to in To Practice and Explore: Text File Utilities #9 to see examples of using tar command Perform Use tar "to stuff" three files and then "unstuff" them into a new directory. Include the -v option. Task ll to show the original 3...
Guide to UNIX Using Linux (4th Edition) 1.What is sed? A Stream editor is used to...
Guide to UNIX Using Linux (4th Edition) 1.What is sed? A Stream editor is used to perform basic transformations on text read from a file or a pipe. The result is sent to standard output. The syntax for the sed command has no output file specification, but results can be saved to a file using output redirection. The editor does not modify the original input. What distinguishes sed from other editors, such as vi and ed, is its ability to...
Using sed unix / linux command how would I execute this: Move the first 2 characters...
Using sed unix / linux command how would I execute this: Move the first 2 characters on each line to the end of the line
please use linux or unix to complete Diff command The diff command displays differences between two...
please use linux or unix to complete Diff command The diff command displays differences between two files on a line-by-line basis. It displays the differences as instructions that you can use to edit one of the files ( using the vi editor) to make it the same as the other. When you use diff, it produces a series of lines containing Append (a), Delete (d), and Change (c) instructions. Each of these lines is followed by the lines from the...
What are control structures in Linux/Unix?
What are control structures in Linux/Unix?
Unix / Linux 21. Given the following command pipeline, provide a diagram (ascii art) or detailed...
Unix / Linux 21. Given the following command pipeline, provide a diagram (ascii art) or detailed description indicating all the Input/Output (I/O) connections. Every stdin, stdout, and stderr for each command will need to connect to something. grep a < words | wc -l > a_count.txt 22. Explain what is wrong (if anything) with the following command pipeline. cd | ls 23. Stream Editor: Write a sed command to delete digits, but only on lines that end with a period....
PLEASE USE LINUX/UNIX 1.Use either pico, vi, or cat to create the following file and name...
PLEASE USE LINUX/UNIX 1.Use either pico, vi, or cat to create the following file and name it as “mysedfile”: Name Class1 Class2 Class3 Tom 92 94 88 Nancy 91 85 95 Lisa 99 77 96 Jerry 84 98 90 2. Please use sed command(s) to complete the following tasks. display Tom’s record. display Lisa’s record. display both Tom’s and Lisa’s records. remove the blank line(s) from “mysedfile.” replace all the digits with *.
The vi text editor can be a bit challenging to use at first, but once you...
The vi text editor can be a bit challenging to use at first, but once you have familiarized yourself with how it works you will find it an efficient way to create and edit text files in Linux, and UNIX as well. The key thing to remember is that vi has two operational modes: insert mode and command mode. In insert mode, everything you type is entered into your file. You can use the backspace, delete and the arrow keys....
linux Using the grep or egrep commands, what would be the full command (including regular expression)...
linux Using the grep or egrep commands, what would be the full command (including regular expression) to view only the lines in the file /boot/grub/grub.cfg that DO NOT begin with a hashtag (the # sign). In other words, what would be the command to print all the lines in this file that do not begin with this character.
Linux Question: Describe how you created above file and its contents in VI. a) Bash/VI commands:...
Linux Question: Describe how you created above file and its contents in VI. a) Bash/VI commands: 20pts; b) Non-brute-force solution: 10pts). Note: Brute-force solution means that entering characters one by one Install JDK 1.8 by the following command: $ sudo dnf –y install java-1.8.0-openjdk-devel.x86_64 Use VI to create a file “YourFirstNameHomework.java” (e.g., “MollyHomework.java”) and add the following contents into it. (grading details: file name format:10 pts, a screenshot of the file content in the VI environment: 10pts, paragraphs: 10pts, empty...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT