0% found this document useful (0 votes)
64 views6 pages

Gzip

gzip is a tool used to compress files to reduce their size by 60-70% of the original. It has options like -l to list file sizes, -r to compress directories recursively, and -d to decompress files. There are three main looping structures in Linux: while loops repeat until a condition is false, until loops repeat until a condition is true, and for loops repeat a set number of times or by incrementing/decrementing a variable.

Uploaded by

therealnapzter
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views6 pages

Gzip

gzip is a tool used to compress files to reduce their size by 60-70% of the original. It has options like -l to list file sizes, -r to compress directories recursively, and -d to decompress files. There are three main looping structures in Linux: while loops repeat until a condition is false, until loops repeat until a condition is true, and for loops repeat a set number of times or by incrementing/decrementing a variable.

Uploaded by

therealnapzter
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

It is used to compress files. It reduces the size of a text file by approximately 6070% of the file size.

Syntax:

gzip[options] [file_name].

-l:Lists the size of the original file & the size after compression.
-r:Compresses directories recursively.If we specify a directory to compress,it will compress all the files stored in the sub-directories. -d:Decompresses the files.

Looping is used to execyte a set of commands repeatedly. To perform looping,you need to specify a set ofinitial conditions,the termination condition and the commands that need to be executed repeatedly. Looping structres are

While Until for

The while Construct

syntax:

while <condition> do <command (s)> Done reply=y while test "$reply" != "n" do echo n "Enter file name?" read fname cat ${fname} echo n "wish to see more files :" read reply done

example

The until Construct

syntax:

until <condition> do <command (s)> Done

Example

a=1 Until [$a gt 10] do

echo $a ((a=$a+1))
done o/p 110

The evaluation pattern of the until loop construct is opposite to that of the while loop.
Until construct execute until the specified condition is evaluates to false

The for Construct


syntax: for var_name in <list of values> do <command (s)> done
Example for i in 1..10 Do Echo $i Done

o/p

1,2,3,..10

syntax2: For (expression1; expression2; expression3)) do <command (s)> done


Expression1 is evaluated once before loop is executed Expression2 and expression3 is evaluated before each iteration. If expression2 evaluates to false, the for loop terminates Example #!/bin/bash for (( a=1; a<=10; a=a+1)) do Echo $a Done

o/p

1,2,3,..10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy