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
Marina CMI [18]
3 years ago
9

1. Write a bash script to create 3 files of different size greater than 1700 kb and less than 1800 kb . The 2. Content of the fi

le must be text characters. File content generated by your script can be characters of your choice. 3. Archive the 3 files created into a single file using the TAR command. (Show command, Note file size) 4. Gzip each of the 3 files individually (note file size) 5. Gzip the TAR file created in step 2. (Note file size) 6. Place results from actions 3, 4, 5 in a readme file that you submit along with your script. Compression values noted in your readme file will be checked against files generated by your script, therefore your accuracy will be verified.
Computers and Technology
1 answer:
Mazyrski [523]3 years ago
4 0

Answer:

See explaination

Explanation:

Bash Script:

#!/bin/bash

echo "Creating files a.txt, b.txt, c.txt..."

#1

# Create a random number between 1700 to 1800. This is the Kb we are looking for

# And then multiply by 1000 (1Kb = 1000 bytes)

r=$(( ($RANDOM % 100 + 1700) * 1000 ))

# head -c specifies the number of chars to read from the input,

# which is /dev/urandom stream in this case.

# Ideally we should have just used r*1000 to specify number of bytes,

# but since we are pipelining it to base64 to get text chars,

# this conversion will happen in the ratio of 4/3.

head -c $r /dev/urandom | base64 > a.txt

# Hence, we trunctate the file to the exact (random number we generated * 1000) bytes

truncate -s $r a.txt

r=$(( ($RANDOM % 100 + 1700) * 1000 ));

head -c $r /dev/urandom | base64 > b.txt

truncate -s $r b.txt

r=$(( ($RANDOM % 100 + 1700) * 1000 ));

head -c $r /dev/urandom | base64 > c.txt

truncate -s $r c.txt

#3 Use tar command to create all_three.tar from a.txt, b.txt, c.txt

tar -cf all_three.tar a.txt b.txt c.txt

echo $(stat -c "%n: %s" all_three.tar)

#4 Gzip a.txt into a.gz (without deleting the original file) and so on

gzip -c a.txt > a.gz

gzip -c b.txt > b.gz

gzip -c c.txt > c.gz

echo $(stat -c "%n: %s " a.gz b.gz c.gz)

#5 Gzip a.txt, b.txt, c.txt into all_three.gz

gzip -c a.txt b.txt c.txt > all_three.gz

echo $(stat -c "%n: %s" all_three.gz)

#6 Gzip the all_three.tar we created in #3

gzip -c all_three.tar > all_three.tar.gz

echo $(stat -c "%n: %s" all_three.tar.gz)

# Check all files we created with ls command sorted by time in ascending order

ls -ltr a.txt b.txt c.txt all_three.tar a.gz b.gz c.gz all_three.gz all_three.tar.gz

You might be interested in
How i can download play store?​
Phantasy [73]

Answer:

in Google type play Store and you will get the app and then click on that word install and it will get installed

Explanation:

hope this helps

3 0
3 years ago
If you were to design a range of athletic shoes for various sports activities, what key factors would you consider during the de
mylen [45]
With this you just have to think about what do different shoes do and why? For example, track shoes need to be extremely light to make it so the runners don't need to move excess weight to accelerate faster whereas basketball shoes can be heavier because they need high ankle coverage for more ankle support during moves like the crossover. Then the key factors that I would do personally are: difficulty to produce, benefit to athlete, cost to athlete, weight, and support. My advice would be to systematically go through a bunch of sports and talk about each of their shoes...
4 0
3 years ago
In reference to operating systems, what is spooling? what does it stand for? chegg
blondinia [14]

Answer:

Spooling is a process in which data is temporarily held to be used and executed by a device, program or the system. Data is sent to and stored in memory or other volatile storage until the program or computer requests it for execution. "Spool" is technically an acronym for simultaneous peripheral operations online.

8 0
2 years ago
Suppose you observe that your home PC is responding very slowly to information requests from the net. And then you further obser
atroni [7]

ANSWER: BOT

EXPLANATION: When a PC is experiencing the listed effects, it thus depicts that the PC is under attack by a bot, which is a type of script or software application that establishes automated tasks via command.

However, a bad bots often initiate malicious tasks that gives room for attackers to take control over an affected PC remotely, most especially for fraudulent activities.

When several affected computers are connected, they form a botnet connection.

6 0
3 years ago
Your company has a team of remote workers that need to use Windows-based software to develop company applications, but your team
timofeeve [1]

Operating systems are the software that supports the basic functioning of the computer. Windows Virtual Desktop is an Azure compute service that will help solve the problem.

<h3>What is Windows Virtual Desktop?</h3>

Windows Virtual Desktop is an app virtualization service of Azure that operates on the cloud platform. It includes standard operating procedures that can be used by users with multiple OS.

Azure's Virtual Desktop supports different versions of window OS. This type of system is majorly used in remote work demands and specialized workloads.

Therefore, Windows Virtual Desktop is an Azure compute service.

Learn more about Azures service here:

brainly.com/question/13144160

#SPJ1

5 0
2 years ago
Other questions:
  • Write a program that will predict the size of a population of organisms. The program // should ask the user for the starting num
    6·1 answer
  • Write an application that asks a user to type an even number or the sentinel value 999 to stop. When the user types an even numb
    8·2 answers
  • A function may return a pointer, but the programmer must ensure that the pointer:
    14·1 answer
  • Determine if the following statement is true or false:
    5·2 answers
  • . What is the relationship between frequency, wavelength and speed of a wave?
    15·1 answer
  • What is the name of the newer communication protocol that is supported by Window 10's version of TCP/IP?
    11·1 answer
  • A group of developers for a startup company store their source code and binary files on a shared open-source repository platform
    14·1 answer
  • What Is entered into the system as input?
    13·1 answer
  • 1. Do our shared social experiences lead us to think<br><br> communication is a cure-all?
    13·1 answer
  • Hiiiiiiiiihwdawdfgthnythgrfergthyjuhgfd
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!