Linux HW 2.1

foooq55
IFT250Lab2E2.docx

<[Spring 2018]>

IFT 250: Shell & Script Programming with Unix

Lab Activity 2E: File Attributes & Vi Editor

Learnings

· Using vi commands to edit/format files

· Explain the output of the long listing command with respect to file attributes

· Demonstrate ability to change file permissions in both relative and absolute way

Part I: Process Data

Consider the files L2E1.iva, L2E2.iva, and L2E3.iva on Blackboard along with this lab. This is the raw performance data collected on a solar photovoltaic module installed at the ASU Polytechnic campus. The 3 files correspond to 3 repeated measurements and must be processed to determine the performance output of the system or panel.

Download the L2E1.iva, L2E2.iva, and L2E3.iva files and upload them into the General server into the ~/IFT383/Unit2/Labs folder.

For this lab, you will use the techniques learned up to Unit 2 to edit and format the data from these three files to obtain a single file named lab2E.1.prc that resembles the following:

F gge0001x gge0001y gge0001z

D 12-30-2006 12-30-2006 12-30-2006

T 14:05:23 14:05:55 14:06:28

S a69 a69 a69

B 15.4 15.3 15.7

M gge06001 gge06001 gge06001

P 30.8 30.6 30.3

Q 19.2 21.1 23.5

R 1006.2 1006.6 1008

U 1012.7 1014.6 1014.1

X 36.2 36.1 36.6

A 38.994 38.994 38.994

G 107.71 107.71 107.71

H 8.411 8.433 8.434

O 37.084 36.705 36.508

C 7.537 7.621 7.546

K 28.198 27.623 27.574

W 212.52 210.51 208.08

L 68.1 68 67.6

You will use vi create a file called lab2E.1.sbs that explains the steps that you followed to create the processed file including all commands and pipelines.

Part II: Checking the List

For this part of the lab fill out the table below with the correct value and answer the following questions.

The following is the results of running the ls -al command on the directory tests:

11

drwx------ 2 kuitche kuitche 2048 Oct 23 20:59 awk

-rw------- 1 kuitche kuitche 808 Jul 24 2000 bin.doc

drwxrwxrwx 3 kuitche root 2048 Jul 12 14:04 junk

-rwxrwxrwx 1 kuitche root 21504 Jul 13 2000 this.jpg

1. Complete the table below

File name

File type

File size

(in bytes)

File Owner

Group permissions

awk

bin.doc

junk

this.jpg

1. What is the size of the tests directory in bytes?

2. What is the command you would use to change the permissions on the file this.jpg the owner is able to read, write, and execute, the group owner is only able to read, and everyone else is able to read and execute?

3. What would be the output of the following sequence of UNIX commands?

bash3.2$ echo this is a script file > script.bash

bash3.2$ chmod 342 script.bash

bash3.2$ ls –al script.bash

4. If you do not know the existing permissions, how would you remove execute and write permissions from everyone but the owner of the file foo.sh without altering any other permission?

Submissions

Once you’ve completed all the activities, perform the following steps for submission:

1. Ensure that all your answers as well as the files you created in this lab are correct and complete.

Page | 5