In: Computer Science
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]
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]*