1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dahasolnce [82]
3 years ago
12

Write commands to carry out the following commands: a) Print all lines containing the string John. b) Print all lines where a wo

rd starts with J. c) Print all lines ending with word stopped. d) Print all lines that don't contain was. e) Print lines where a word begins with K or k. 2. Write a bash script that copies all files of the current directory into a new sub-directory, and then deletes the created sub-directory along with its contents and displays a message that indicates completion of the task. 3. Write a bash script that reads two numbers x and y and performs addition, subtraction, multiplication, and division of the two numbers (x y, x-y, x*y, x/y) and prints out each of these values along with some text to indicate what these numbers are.
Computers and Technology
1 answer:
egoroff_w [7]3 years ago
3 0

Answer:

see explaination

Explanation:

1.

1. grep 'John' FileName

2. grep '^\J' FileName

3. grep 'stopped$' FileName

4. grep -v -e 'was' FileName

5. grep -E '^(k|K)' FileName

2.

#print the message to create subdirectory

echo "Creating a subdirectory to copy current directory files into named 'sub'"

#create subdirectory

mkdir sub

echo "Directory successfully created"

#Copy the files in the current working directory to created subdirectory

echo "Copying files of current directory into newly created subdirectory"

rsync -a --exclude='sub' * sub

#display the message to copy the files

echo "Copying operation completed successfully"

echo "Now deleting the created subdirectory along with its contents"

rm -rf sub

#indicated the message completion of task

echo "Operation completed successfully."

3.

#prompt and read the first number

echo "Enter the first number: "

read x

echo "Enter the second number: "

read y

#Compute arithmetic operations and store in the

#respective variable

addition=$(($x + $y))

subtraction=$(($x - $y))

multiplication=$(($x * $y))

division=$(($x / $y))

#print the values

echo "Addition of $x and $y is $addition"

echo "Subtraction of $x and $y is $subtraction"

echo "Multiplication of $x and $y is $multiplication"

echo "Division of $x and $y is $division"

You might be interested in
How can ascii be used to represent characters in computer system
Furkat [3]

It is a code for representing 128 English characters as numbers, with each letter assigned a number from 0 to 127. For example, the ASCII code for uppercase M is 77. Most computers use ASCII codes to represent text, which makes it possible to transfer data from one computer to another.

7 0
3 years ago
When preparing images to be used for different mediums print web and video in photoshop different file formats are required , se
Anika [276]
The answers are :
JPEG - Compresses well without losing quality, it should be used for the web
TIFF - Can be saved in an uncompressed file format with a high resolution, it is a common file format used for professional print services
BMP - Can be saved in a compressed or uncompressed file format, It is a common file format used for either web or print
<span>FLV or SWF - Used to publish a rendered video for use on the web</span>
5 0
3 years ago
Windows Hello supports multiple biometric authentication methods, including facial recognition. What is the failsafe method to a
Orlov [11]

Answer:

The failsafe method when facial recognition method is unavailable is the Personal Identification Number (PIN) method.

Explanation:

The Personal Identification Number (PIN) option is available for setup for cases when other biometric authentication methods fail due to several reasons.

6 0
2 years ago
The domain name system ________. Question 2 options: A) is a way to find a host's IP addresses if your computer only knows the h
ra1l [238]

Answer:

C) both a and b

Explanation:

13) The domain name system ________.

A) is a way to find a host's IP addresses if your computer only knows the host's host name

B) is a general naming system for the Internet

C) both A and B

D) neither A nor B

8 0
1 year ago
Which statement describes a printer driver? a) It is the configuration code that is sent to a printer to identify the operating
White raven [17]

Answer:

Option (b) is the correct and suitable answer for the above question.

Explanation:

The printer is a hardware which is used to convert the soft copy of an information to a printed copy (Hard copy) of information.

To use printer hardware a computer system needs a printer driver which is used to do the conversion from soft copy to a hard copy. Hardware printer uses only for the purpose to print the copy.

The option b says that the printer driver is used to convert the document into the form of that document which the printer can understand easily. It means conversion from soft copy to hard copy. Hence it is the right option.

The reason behind the other option which is not valid because--

Option a says that the printer driver is a code but it is a software.

Option c says that the printer driver is an interface but it is a software.

Option d says that the printer driver is a cache but it is a software.

4 0
2 years ago
Other questions:
  • Which of the following formats can algorithms NOT be written in:
    13·1 answer
  • What are the cause of eye strain during computer usage?
    7·1 answer
  • The optional feature in a business letter is
    10·1 answer
  • The graph shows that sixty-eight percent of students think cyberbullying is a problem. One hundred human stick figures are shown
    14·2 answers
  • Which statistical function in a spreadsheet helps you to see how far each number varies, on average, from the average value of t
    5·1 answer
  • For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions)
    13·1 answer
  • Following the car in front of you at a closer distance _____.
    6·2 answers
  • File-sharing utilities and client-to-client communication applications can provide the capability to share files with other user
    14·1 answer
  • I will mark you as brainlist
    10·2 answers
  • explain the joke, “There are 10 types of people in the world: those who understand binary and those who don’t.”
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!