User Tools

Site Tools


opus:spring2012:tedmist1:part1

Part 1

Entries

Entry 1: January 24, 2012

As an aid, feel free to use the following questions to help you generate content for your entries:

  • What action or concept of significance, as related to the course, did you experience on this date?
I learned how to use the ls utility.

* Why was this significant?

The significance of this is that I now know how to create a file listing within my current working directory.

* What concepts are you dealing with that may not make perfect sense?

The arguments to the ls utility.

* What challenges are you facing with respect to the course?

Remembrance of all the commands that need to be used.

Entry 2: January 24, 2012

As an aid, feel free to use the following questions to help you generate content for your entries:

  • What action or concept of significance, as related to the course, did you experience on this date?
Learned how to use the man(Manual) utility.

* Why was this significant?

This is significant because the manual pages provides in depth information about the requested command or allows users to search for commands related to a particular keyword.

* What concepts are you dealing with that may not make perfect sense?

How to successfully use the man command.

* What challenges are you facing with respect to the course?

Learning the arguments with certain commands.

Entry 3: February 8, 2012

As an aid, feel free to use the following questions to help you generate content for your entries:

  • What action or concept of significance, as related to the course, did you experience on this date?
Learned how to use the file command.

* Why was this significant?

This is significant because the file command tells me what type of file you are looking at is.

* What concepts are you dealing with that may not make perfect sense?

The arguments to the file command.

* What challenges are you facing with respect to the course?

Dealing with compressed files, such as gzip.

Entry 4: February 8, 2012

As an aid, feel free to use the following questions to help you generate content for your entries:

  • What action or concept of significance, as related to the course, did you experience on this date?
Learned how to use the wc(Word Count) command.

* Why was this significant?

This is significant because it gives you a word,line, and character count within the certain file.

* What concepts are you dealing with that may not make perfect sense?

Options such as “head”, and “tail” to use them correctly.

* What challenges are you facing with respect to the course?

Challenges that are facing me with respect to the course is using commands to a certain order.

Keywords

unix Keywords

Local Host

Definition

Definition (in your own words) of the chosen keyword.

Standard host name given to the address of the network interface.
Demonstration

Demonstration of the chosen keyword.

lab46:~$ netstat
Active Internet connections (w/o servers)
Proto Revc-Q Send-Q Local Address            Foreign Address       State
tcp   0      0      lab46.offbrone.la:60002  irc.offbyone.lan:ircd Established
lab46:~$ 

Remote Host

Definition

Definition (in your own words) of the chosen keyword.

A computer that is in a different location than your computer but which you can log on to from your computer.
Demonstration

Demonstration of the chosen keyword.

Step 1. On the local host

Type the following at the command line:

lab46:~$ xhost + Remote Host IP address < press return >

Step 2. Log on to the remote host

lab46:~$ telnet Remote Host IP address < press return >

Home Directory

Definition

Definition (in your own words) of the chosen keyword.

A directory owned by a user and dedicated to storage of the user's personal files.
Demonstration

Demonstration of the chosen keyword.

lab46:~$ 
lab46:~$ cd home
lab46:~/home$
lab46:~/home$ ls
tedmist1
lab46:~/home$
lab46:~/home$ cd .
lab46:~/home$
lab46:~/home$ cd .. 
lab46:~$ 

Current Working Directory

Definition

Definition (in your own words) of the chosen keyword.

The default directory of a process from which all relative path names are resolved.
Demonstration

Demonstration of the chosen keyword.

pwd (Print Working Directory): Displays the name of your working directory.
lab46:~$ 
lab46:~$ pwd
/home/tedmist1
lab46:~$ 

Regular Files

Definition

Definition (in your own words) of the chosen keyword.

A file that's not a directory, a device, a named pipe or socket, or a symbolic link.
Demonstration

Demonstration of the chosen keyword.

ls (List Files): Display information about the contents of a directory.

* Listing only of a few regular files in my personal directory.

lab46:~$ ls
count.c
courses.html
cs.html
display.c
dtypes.c
file.txt
lab46:~$ 

Directory Files

Definition

Definition (in your own words) of the chosen keyword.

A file that consists solely of a set of other files.
Demonstration

Demonstration of the chosen keyword.

ls (List Files): Display information about the contents of a directory.

* Listing only of Directory files in my personal directory.

lab46:~$ ls
Mail
Maildir
archives
cd
devel
home
lab2
ls
p
public_html
script
shell
src
src.bak
tedmist1
lab46:~$ 

Special Files

Definition

Definition (in your own words) of the chosen keyword.

A device file or special file is an interface for a device driver that appears in a file system as if it were an ordinary file.
Demonstration

Demonstration of the chosen keyword.

ls (List Files): Display information about the contents of a directory.

* Listing only of special files in my personal directory.

lab46:~$ ls
Maildir
motd
lab46:~$

File Manipulation

Definition

Definition (in your own words) of the chosen keyword.

The act of changing a file to your certain needs and or requirements.
Demonstration

Demonstration of the chosen keyword.

chmod (Change File Mode): Change permissions for a file.

- Syntax: chmod mode file… * Where mode is the new file mode, and file is the name of a file or directory.

The first number represents the permission for the userid that wons the files; the second number represents the permissions for the userids in the group; the third number the permissions for all the userids on the system.

6 = permissions for owner
0 = permissions for group
0 = permissions for all other userids
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use the following numeric value for the various permissions.

4 = read permission
2 = write permission
1 = execute permission
0 = no permission

Owner: read + write + execute = 4 + 2 + 1 = 7
Group: read + write = 4 + 2 + 0 = 6
Other: read = 4 + 0 + 0 = 4
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Owner Group Other Mode File
rwx = 7 | rwx = 7 | rwx = 7 | 777 | program.allusers
rwx = 7 | rwx = 7 | — = 0 | 770 | program.group
rwx = 7 | — = 7 | — = 0 | 700 | program.owner
rw- = 7 | rw- = 7 | rw- = 6 | 666 | text.allusers
rw- = 7 | rw- = 7 | — = 0 | 660 | text.group
rw- = 7 | — = 0 | — = 0 | 600 | text.owner
lab46:~$ 
lab46:~$ chmod 777 file.txt
lab46:~$ 
lab46:~$ ls 
file.txt (should be indicated as a changed file, a green coloration is used to indicate such things in Unix)
lab46:~$ 

unix Objective

Exposure to Command-Line Tools and Utilities

State the course objective

Exposure to command-line tools and utilities.
Definition

In your own words, define what that objective entails.

The objective entails that throughout the course you will gain some, if not a lot of knowledge around the basics of command-line interfaces and the utilities involved with the type of interface.
Method

State the method you will use for measuring successful academic/intellectual achievement of this objective.

The method of academic/intellectual achievement of this objective can only be done through the amount of usage(time) spent using a command line interface.
Measurement

Follow your method and obtain a measurement. Document the results here.

This can be measured by how comfortable the user is with the language and syntax involved with CLI systems. The more commands you can remember the easier job it will be for the user to do his or her job.
Analysis

Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.

  • How did you do?
So far I am learning about CLI, there wont be a point in which I know everything about CLI. Theres always something to learn about the subject at hand.
  • Is there room for improvement?
Yes, there is always room for improvement.
  • Could the measurement process be enhanced to be more effective?
The more you use a CLI the more effective you will be as a user. Knowing the commands is only part of the job, but correct implementation is the hard part.
  • Do you think this enhancement would be efficient to employ?
Yes, broadening your horizon upon the multiple interfaces that computers can employ only make you a better end user.
  • Could the course objective be altered to be more applicable? How would you alter it?
The course object is applicable at the moment, so alterations to the objective are not needed in current time.

Experiments

Experiment 1

Question

What is the question you'd like to pose for experimentation?

Is there anyway of comparing two separate files?

Resources

Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.

My information was provided from Harley Hahn's Guide To Unix and Linux, Chapter 17: Filters: Comparing and extracting.

Hypothesis

Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.

If there is a way of comparing two different files, then there is a command to do such act.

State your rationale.

My rationale was provided from my curiosity in which of finding the differences between two files.

Experiment

How are you going to test your hypothesis? What is the structure of your experiment?

I'm going to test my hypothesis by conducting an experiment using two different files, preferably text files. And using the “cmp” or “comm” commands to differentiate those two files.

Data

Perform your experiment, and collect/document the results here.

In my shell directory consisted multiple text files from a previous assignment. This worked perfectly for my experiment being conducted. Thus using the “comm” utility I conducted the experiment on multiple occasions. Once again the “comm” utility finds differences between the two files. Thus at the prompt it looked like this: lab46:~/shell$ comm file1 filea. Entering such command I got a return of “More text …”. This is because inside file1 consists the words “More text …” and filea is an empty file. Thus, the difference was “More text …” just as “comm” told me. Another showing of how “comm” works is that when trying to find the differences between file2 and fileZZZ using the utility “comm” was quite useful. Thus the command was “lab46:~/shell$ comm file2 fileZZZ”. The return of that command was “file1”, “file1234”. Thus the differences between those two files were “file1” and “file1234”.

Analysis

Based on the data collected:

  • Was your hypothesis correct?
Yes, my hypothesis was correct.
  • Was your hypothesis not applicable?
My hypothesis was applicable.
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
There was more to the return prompt than I originally thought.
  • What shortcomings might there be in your experiment?
The usage of only using two text files, rather than using other files types also.
  • What shortcomings might there be in your data?
My data is centered around two text files, though other file types can be used.

Conclusions

What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.

My conclusions to this experiment is that it can be very helpful when comparing different files. Though questions did arise when conducting the experiment. For instance, can you compare different directories, not just files. And, is there a way of comparing more than just two files at once, possibly three if not four files at once.

Experiment 2

Question

What is the question you'd like to pose for experimentation? State it here.

Is there anyway you can combine multiple files, but save the output in a different file?

Resources

Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.

My information was provide from Harley Hahn's Guide to Unix and Linux, Chapter 16: Filters: Introductions and Basic Operations.

Hypothesis

Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.

If it is possible to combine multiple files, but save the output in a different file, then file management will be a much smaller and easier process.

State your rationale.

My rationale was that of in which I was curious that in Unix there was a way of combining multiple files into one.

Experiment

How are you going to test your hypothesis? What is the structure of your experiment?

Im am going to test my hypothesis by using the same files, and directory, as in experiment one (~/shell$). And I am planning on copying multiple files and combining them all into a seperate file within that directory. This can be done using the cat command.

Data

Perform your experiment, and collect/document the results here.

Doing this experimented was conducted using the cat command, under the syntax of “cat file file2 file3 > file4”. Thus, my syntax looked very similar to that, considering I had similar file names. My command looked like “lab46:~/shell$ cat file1 file2 file3 > fileC”. I copied all the text files into a new file called “fileC”. When listing the files in the directory using the ls command it was clear I had created the “fileC” file. Though, did everything copy into it? Using the cat command once again I looked the file. Using the command “cat fileC” I could see what “fileC” contained. After running the program it had given me a return of “More text …”, “file1”, and “file1234”. This clearly showed that when I had copied all those files previously that the contents also copied over into the new “fileC” file. Thus, the cat program ran correctly as planned.

Analysis

Based on the data collected:

  • Was your hypothesis correct?
Yes, my hypothesis was correct.
  • Was your hypothesis not applicable?
My hypothesis was applicable.
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
Using file system converters like > was unexpected before I had conducted the experiment.
  • What shortcomings might there be in your experiment?
Shortcomings that might be in my experiment is that I only used a certain type of file was used, text files.
  • What shortcomings might there be in your data?
Shortcomings that might be in my data is that I only used a certain type of file was used, text files.

Conclusions

What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.

My conclusions for this experiment is that it can be very helpful when trying to clear up a directory. Making the directory look a lot nicer by combining files into one. Though the cat command used in this experiment is not the only once you could use, there are other available at your disposal.

Experiment 3

Question

What is the question you'd like to pose for experimentation? State it here.

Is there a way of converting a certain text file into octal and or hexadecimal format?

Resources

Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.

My information came from Harley Hahn's Guide to Unix and Linux, Chapter 21: Displaying Files: Binary, Octal and Hexadecimal.

Hypothesis

Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.

If there is a text file within a directory, then there is a way to convert that text file into octal and or hexadecimal format.

State your rationale.

My rationale was that of the curiosity in which if it was possible to convert a text file into octal and or hexadecimal format.

Experiment

How are you going to test your hypothesis? What is the structure of your experiment?

I am going to test my hypothesis by converting simple text files over into octal and hexadecimal format. This will be done using the commands “od” (octal dump), and “hexdump” (hexadecimal dump), and text files within the shell directory.

Data

Perform your experiment, and collect/document the results here.

Running the commands “od” and “hexdump” on both the files “file1” and “file2” within the directory ~/shell$. Thus the commands looked like this: “od file1”, “hexdump file1”, and “od file2”, “hexdump file2”.
My data for this experiment went as followed:

“od file1”: → 0000000 067515 062562 072040 074145 020164 027056 005056005012 0000020 072012 064541 005154 0000026

“hexdump file1”: → 000000 6f4d 6572 7420 7865 2074 2e2e 0a2e 0a0a 0000010 740a 6961 0a6c 0000016

“od file2”: → 0000000 064546 062554 005061 064546 062554 031061 032063 000012 0000017

“hexdump file2”: → 0000000 6966 656c 0a31 6966 656c 3231 3433 000a 000000f

Analysis

Based on the data collected:

  • Was your hypothesis correct?
Yes, my hypothesis was correct.
  • Was your hypothesis not applicable?
My hypothesis was applicable.
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
The experiment went as planned, no unexpected occurrences happened.
  • What shortcomings might there be in your experiment?
Shortcomings in my experiment would be that I had only used text files rather than using other file types.
  • What shortcomings might there be in your data?
Shortcomings in my data would be that I had only used text files rather than using other file types.

Conclusions

What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.

My conclusions on this experiment is that these commands can be very helpful if that you are looking the view the octal and or hexadecimal values of a certain text file. Though during this experiment I wondered that are the “od” and “hexdump” commands limited to just text files? Can they unwind other file types into their decimal values?
opus/spring2012/tedmist1/part1.txt · Last modified: 2012/04/02 02:23 by tedmist1