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]
4 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]4 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
To mark all modifications made to the document, activate the
Mariulka [41]

Answer:

Compare

Explanation:

5 0
3 years ago
Read 2 more answers
A network is a group of two or more computers that are connected to share resources and information. T or f
Ulleksa [173]

Answer:

true

Explanation:

5 0
3 years ago
Read 2 more answers
how such a company can improve the focus and relationship with customers, and what they will benefit from this improvement.
aalyn [17]
They can work and talk with customers and see what customers want and tailor to some of the customers need. Ask for feed back and reviews and customers will be more likely to shop again if they feel the business cares what they think.
7 0
4 years ago
What is a certificate? Select one: a. A certificate used to encrypt a message in PKI b. A method of certifying the strength of a
lozanna [386]

Answer:c)A digital document that is used to verify the owner's identity

Explanation: Certificate is termed as the digital document that helps in exchanging information or data with protection over the internet.It is used for the maintenance of authentication of user .They are provided with he username and password for the security which can be accessed by the authorized party only.

It verifies the the message sent is by the authorized user and the receiver the decrypts the message.Other options are incorrect because it does not encrypts the data rather has encrypted password and does not certify or change the key's strength .Thus, the correct option is option(c).

8 0
3 years ago
Need help please will mark brainliest
aleksklad [387]

Answer:

intranet

Explanation:

An intranet is a private network that you can't access outside the physical boundary of an organization

7 0
3 years ago
Other questions:
  • Jean-Ann works in the finance business. She analyzes insurance applications in order to determine the level of risk involved in
    11·1 answer
  • What is the difference between a learner’s license and an operator’s license?
    13·1 answer
  • Passing structured query language commands to a web application and getting the website to execute it is called SQL script:_____
    12·1 answer
  • Web-based e-mail like Hotmail is an example of three-tier client-server architecture that provides access to e-mail messages. Tr
    7·1 answer
  • 4. What is the simplest way to permanently get rid of an unwanted file?
    12·1 answer
  • If you created a variable called name, what data type would that value be?
    7·2 answers
  • Write a program that defines an array of integers and a pointer to an integer. Make the pointer point to the beginning of the ar
    12·1 answer
  • Identify the correct answer in each item. Write your answer on the blank provided before
    13·1 answer
  • What defines the scope of a project?
    5·1 answer
  • confidentiality ensures that only those with the rights and privileges to access information are able to do so.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!