======Part 2======
=====Entries=====
====Entry 5: March 2, 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 change file permissions, using chmod command.
* Why was this significant?
>> This is significant because it lets you change the file to what you want it to be. For instance if the file is read only, you could possible change that so you can also write to the file.
* What concepts are you dealing with that may not make perfect sense?
>> The numbering systems involved with chmod.
* What challenges are you facing with respect to the course?
>> Remembrance off all the chmod possibilities involved with file changes.
====Entry 6: March 7, 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 display currently running processes, using the ps(1) command.
* Why was this significant?
>> The significance of this is that it tells you what programs are running at the current moment, and their computing information, such as PID's and CPU usage.
* What concepts are you dealing with that may not make perfect sense?
>> Arguments to the ps(1) command.
* What challenges are you facing with respect to the course?
>> Using the cron command.
====Entry 7: March 13, 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 compile/assemble source files into executables.
* Why was this significant?
>> This is significant because now I can run C code from an executable file.
* What concepts are you dealing with that may not make perfect sense?
>> Arguments involved with gcc/g++ compilers.
* What challenges are you facing with respect to the course?
>> Creating files that need to be compiled at a later date.
====Entry 8: March 9, 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 grep command.
* Why was this significant?
>> This is significant because the grep command will find text within a certain file for you.
* What concepts are you dealing with that may not make perfect sense?
>> Using wildcard helpers with grep.
* What challenges are you facing with respect to the course?
>> The usage of wildcards to have successful data results.
=====Keywords=====
{{page>unixpart2&nofooter}}
=====Experiments=====
====Experiment 4====
===Question===
What is the question you'd like to pose for experimentation? State it here.
>> Is there anyway display commands from a history list and then re execute a command from the history list?
===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 13: Using the Shell: Commands and Customization.
===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 to display commands from a history list, then I can re execute those commands from the history list using another command.
State your rationale.
>> My rationale involving my experiment was that of the curiosity in which I could look back in time to see what commands I have used.
===Experiment===
How are you going to test your hypothesis? What is the structure of your experiment?
>> During this experiment I will be running the command, "**history**", to display commands from the history file. From there I will be the commands "**!**" and "**!!**" to perform different needed tasks. The command "**!**" will re execute a certain command number from the history list. While, "**!!**" will re execute the last command used from the history list.
===Data===
Perform your experiment, and collect/document the results here.
>> When running the "**history**" I get a listing from the command numbers used of 321 to my most current command 533 or history. If I run the "**!**" command, for example of line 521, which was a "**ls**" command used earlier. The prompt would look like this "!521", thus if done right an listing of files should have appeared in your home directory, just as the ls was directed for earlier. The format for the "**!**" goes as the following "!filename". Since the "**!!**" will re execute the last command in the history list, the same ls should appear if you had used the "**!!**" command. If all completed right you would have two file listings of your home directory in visible sight.
===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 command worked just as I thought it would have.
* What shortcomings might there be in your experiment?
>> There are no foreseen shortcomings in my experiment.
* What shortcomings might there be in your data?
>> There are no foreseen shortcomings in my data.
===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.
>> In conclusion using the **history** command can be very useful if you had forgotten a certain command used a while back. Also the "**!**" command can be a quick way to use that same forgotten command if you don't want to retype out that command.
====Experiment 5====
===Question===
What is the question you'd like to pose for experimentation? State it here.
>> Is there a way to run programs at a lower priority in comparison to other programs running?
===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 26: Processes and Job Control.
===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 to run programs at a lower priority then what command can be used to do such actions.
State your rationale.
>> My rationale for this question is that when running multiple commands, how can you prioritize which needs more priority over the other.
===Experiment===
How are you going to test your hypothesis? What is the structure of your experiment?
>> I am going to test my hypothesis by running a command and setting it to run in the background. Then run another program. Using the **ps** utility check out the %CPU usage for the commands used. And **hello** and **hello2** as the desired executable. I will be using the files **hello.c** and **count.c** as the files with the program source code.
===Data===
Perform your experiment, and collect/document the results here.
>> To run programs at a lower priority use **nice(1)**.
>> Syntax: **nice** [**-n** adjustment] command.
>> However, **nice** will not automatically run the program in the background. You will need to do that yourself by typing an **&** character at the end of the command.
lab46:~$ nice gcc -o hello hello.c &
[1] 13842
lab46:~$ gcc -o hello2 count.c
lab46:~$ ps
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
tedmist1 13123 1.0 0.1 13628 1956 pts/74 SNs 12:53 0:00 -bash
tedmist1 13955 0.0 0.0 8588 996 pts/74 RN+ 14:07 0:00 ps u
tedmist1 13465 2.0 0.1 9525 992 pts/74 RN+ 14:07 0:00 nice gcc -o hello hello.c &
tedmist1 13812 1.1 0.0 8678 994 pts/74 RN+ 14:07 0:00 gcc -o hello2 count.c
===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)
>> More commands were needed to be used than I originally thought I had to use.
* What shortcomings might there be in your experiment?
>> I had only ran two programs while there could have been more
programs running at once, thus making my experiment more applicable.
* What shortcomings might there be in your data?
>> I used the gcc compiler only, I could have used the g++ compiler. Possibly could have gotten different results, thus different data.
===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.
>> From my experiment, provided above, I can say that I know now how to set commands, while running in the background, to a lower priority over other commands running. This can be very helpful if you have a program that can run in the background and which uses a large amount of CPU time. Using the **nice(1)** utility provides that the program have a reduced amount of CPU usage. Thus, leaving other programs to use that CPU speed.
====Retest 2====
Perform the following steps:
===State Experiment===
Whose existing experiment are you going to retest? Provide the URL, note the author, and restate their question.
>> I will be retesting Reid Hensen's Experiment 3 in Part One.
>>
>> http://lab46.corning-cc.edu/opus/spring2012/rhensen/start
>>
>> Question: Is it possible to remove a directory by deleting the . file that is contained within the directory?
===Resources===
Evaluate their resources and commentary. Answer the following questions:
* Do you feel the given resources are adequate in providing sufficient background information?
>> I do not, no resources were provided for the experiment.
* Are there additional resources you've found that you can add to the resources list?
>> I would add Chapter 25: Working with Files, found in Harley Hahn's Guide to Unix and Linux.
* Does the original experimenter appear to have obtained a necessary fundamental understanding of the concepts leading up to their stated experiment?
>> Yes, I do believe the original experimenter appeared to have an understanding of the concepts prior their experiment.
===Hypothesis===
State their experiment's hypothesis. Answer the following questions:
>> Their experiment's hypothesis: "Each directory contains two files which are ”.” and ”..”. The . file refers to the directory itself and the .. file refers to the parent of that directory. These files are in each directory to allow the Unix shell to use relative path names. I believe that if the . file is removed, this would logically cause the current working directory to be deleted. It would seem to be a problem if Unix allowed the user to do this, which is why I believe that removing directories cannot be done in this way."
* Do you feel their hypothesis is adequate in capturing the essence of what they're trying to discover?
>> Yes, I do believe so.
* What improvements could you make to their hypothesis, if any?
>> Make it shorter and to the point. No need for a lengthy hypothesis.
===Experiment===
Follow the steps given to recreate the original experiment. Answer the following questions:
* Are the instructions correct in successfully achieving the results?
>> Yes, the instructions are correct in achieving the results.
* Is there room for improvement in the experiment instructions/description? What suggestions would you make?
>> No, the instructions are straight forward and easy to follow.
* Would you make any alterations to the structure of the experiment to yield better results? What, and why?
>> No, I would not do so because there is no changing what the experiment can entitle. Different results are not obtainable for this experiment.
===Data===
Publish the data you have gained from your performing of the experiment here.
lab46:~/test$ rm .
rm: cannot remove `.': Is a directory
lab46:~/test$ rmdir .
rmdir: failed to remove `.': Invalid argument
===Analysis===
Answer the following:
* Does the data seem in-line with the published data from the original author?
>> Yes, the data is in-line with the published data from the original author.
* Can you explain any deviations?
>> No deviations in data.
* How about any sources of error?
No sources of error, besides the ones in experiment.
* Is the stated hypothesis adequate?
>> The stated hypothesis is adequate.
===Conclusions===
Answer the following:
* What conclusions can you make based on performing the experiment?
>> The started hypothesis was correct on the results of the experiment.
* Do you feel the experiment was adequate in obtaining a further understanding of a concept?
>> No, no further knowledge was learned from this experiment.
* Does the original author appear to have gotten some value out of performing the experiment?
>> The knowledge that you cannot remove your current working directory.
* Any suggestions or observations that could improve this particular process (in general, or specifically you, or specifically for the original author).
>> No suggestions to be made or needed in this experiment.