Find existing files or create files that

a. gzip compresses by more than 80 percent
b. gzip compresses by less than 10 percent
c. get larger when compressed with gzip
Use ls –l to determine the sizes of the files in question. Can you characterize the files in a, b, and c?

This is a lab that you should do in front of the computer. I can suggest that most text files and uncompressed database files can be compressed by more than 80%. Most image files (.jpg, .png, etc) will be compressed by less than 10%. I suppose zip files will get larger, by definition.

To find existing files or create files that meet the given criteria, we can follow these steps:

1. Open a terminal or command prompt.
2. Navigate to the directory where you want to search for or create the files.
3. Use the `ls -l` command to list the files in the directory along with their sizes.
4. Identify the files that satisfy the desired conditions.

a. To find files that gzip compress by more than 80 percent:
- Look for files where the compressed size is less than or equal to 20% of the original size.
- For example, if a file has a size of 1 MB, the compressed size should be 200 KB or less.
- Use the `gzip` command to compress a file and check the compressed size:
```
gzip -c file_name > compressed_file_name.gz
ls -l file_name compressed_file_name.gz
```
- If the compressed size is less than or equal to 20% of the original size, the file satisfies the condition.

b. To find files that gzip compress by less than 10 percent:
- Look for files where the compressed size is more than 90% of the original size.
- For example, if a file has a size of 1 MB, the compressed size should be 900 KB or more.
- Use the `gzip` command to compress a file and check the compressed size:
```
gzip -c file_name > compressed_file_name.gz
ls -l file_name compressed_file_name.gz
```
- If the compressed size is more than 90% of the original size, the file satisfies the condition.

c. To find files that get larger when compressed with gzip:
- Look for files where the compressed size is greater than the original size.
- Use the `gzip` command to compress a file and check the compressed size:
```
gzip -c file_name > compressed_file_name.gz
ls -l file_name compressed_file_name.gz
```
- If the compressed size is greater than the original size, the file satisfies the condition.

Note: The specific files that satisfy the given conditions will depend on the files present in the directory.

To find existing files that satisfy the given conditions, you can use the following steps:

a. To find files that gzip compress by more than 80%:
1. Open a terminal or command prompt.
2. Navigate to the directory where the files are located using the `cd` command.
3. Execute the following command to list files and their sizes in human-readable format: `ls -l -h`.
4. Check the sizes of the files listed. If a file's compressed size is more than 80% smaller than its original size, it meets the condition.

b. To find files that gzip compress by less than 10%:
1. Follow the same steps as in part a.
2. Check the sizes of the files listed. If a file's compressed size is less than 10% smaller than its original size, it meets the condition.

c. To find files that get larger when compressed with gzip:
1. Follow the same steps as in part a.
2. Calculate the percentage change in size after compression for each file.
- Subtract the compressed size from the original size.
- Divide the result by the original size.
- Multiply the quotient by 100 to get the percentage change.
3. If the calculated percentage change is positive, it means the file has gotten larger when compressed.

Using `ls -l` provides information about file sizes and permissions. The sizes of the files listed can be used to determine their characteristics in terms of compression.