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
Owners of individual domains get to decide what content is published on their websites. Why might this autonomy be important to
Alika [10]

Answer:

Explanation:

With an individual domain name we can upload all the content we want, in a free domain or share domain, upload content in some cases have a limit, for example the size of an image, in an individual domain we can add our brand, in a shared, we can add our brand side to company share those domains, we can have our own email address, practically we have a complete autonomy in our website.

4 0
3 years ago
Recently, a serious security breach occurred in your organization. An attacker was able to log in to the internal network and st
natulia [17]

Answer: Geotagging was enabled on her smartphone

Explanation:

The security weakness that is the most likely cause of the security breach is that geotagging was enabled on the vice president's smartphone.

Geotagging, occurs when geographical identification metadata are added to websites, photograph, video, etc. Geotagging can be used to get the location of particular place.

In this case, since geotagging was enabled on her smartphone, it was easy for the attacker to locate her house.

8 0
3 years ago
The question is in the photo
Anastaziya [24]

Answer:

a

the most suitable answer

8 0
2 years ago
Hillary’s family is thinking of relocating to a different city to save money. They set up a budget comparing the cost of living
vova2212 [387]

Answer: Oakland, and also a city they feel is the safest + best for there family

Explanation:

3 0
2 years ago
Which term refers to actions that you would typically perform on a computer to revive it even if it functions in an unexpected m
sweet-ann [11.9K]
You'd usually reboot a PC if it malfunctions.
6 0
2 years ago
Other questions:
  • A _______ record is responsible for resolving an ip to a domain name.
    9·1 answer
  • Write an expression that evaluates to true if and only if the value of the integer variable workedOvertime is true.
    7·1 answer
  • ________ is a program that runs on a computer to manage and control a computer's activities.
    11·1 answer
  • On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance
    10·1 answer
  • What are personal skills?
    5·1 answer
  • Lisa has a section of her document that she would like to include in the index. Which option should Lisa choose?
    12·1 answer
  • Dr. Wayne is trying to developing techniques to cure Parkinson’s disease by inserting genetic material into patients’ cells to c
    12·1 answer
  • About C header files of C programming
    8·1 answer
  • What is the difference between a crosstab query and a subquery?
    11·2 answers
  • Any my hero academia fans out there don't report at all just what more friends to
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!