Table of Contents

Part 2

Entries

Entry 5: March 2nd, 2012

Today I tried my first time doing scripting. I liked doing the scripting a lot and I believe it strengthened my decision in learning more in the programming field. At first i did have trouble starting with the logic and syntax that needed to be used to have the scripting work, but once I got used to it it was fairly easy.

Entry 6: March 9th, 2012

Today I learned how to make a bot. I really liked the bot in several irc's that i've been in before by their interaction knowing it was just me talking to a computer. After figuring out how to download the phenny file to PuTTY and not my computer I felt comfortable using some scripting to give the bot more functionality.

Entry 7: March 16th, 2012

Today I attempted to use the command “find” I had a lot of trouble using this command because i forgot about the STDERR (2>) and the path “/dev/null”. after wedge mentioned to me that it should help get rid of the errors from the output of “find” the command was very easy to use. This command along with grep work very nicely in finding files and words in those files.

Entry 8: March 23rd, 2012

Today in Unix Fundamentals I learned how to construct a website from using the PuTTY public.html directory. This interested me a lot in web design because I've always liked tinkering with websites even in my years at the Boces camput in Hornell. Maybe is programming isn't the thing for me I may take a direction in web design.

Keywords

unix Keywords

Keyword "df"

Definition

df locates all of the running directories used by a users system and each directories disk space usage.

Demonstration
lab46:~$ df
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            4.0G  2.5G  1.4G  65% /
tmpfs                 766M     0  766M   0% /lib/init/rw
udev                  738M   36K  738M   1% /dev
tmpfs                 766M  4.0K  766M   1% /dev/shm
/dev/xvda2            248M   13M  223M   6% /tmp
nfs:/home             2.8T  1.4T  1.4T  49% /home
nfs:/lib/mail         2.8T  1.4T  1.4T  49% /var/mail
lab46:~$

Keyword "who"

Definition

The who command shows who is currently logged on and if their messaging is on(+) or off(-).

Demonstration

Demonstration of the chosen keyword.

lab46:~$ who
NAME       LINE         TIME             IDLE          PID COMMENT
jjohns43 + pts/24       2012-01-23 12:18 08:45         701 (cpe-74-65-82-173:S.0)
jjohns43 + pts/26       2012-02-29 14:40  old        21533 (cpe-74-65-82-173:S.1)
thakes3  + pts/32       2012-03-16 15:39 03:44        6464 (:pts/8:S.0)
wedge    - pts/72       2012-04-01 09:42 00:32       10102 (telstar.lair.lan)
tedmist1 + pts/74       2012-04-01 12:53 00:34       13120 (cpe-67-252-119-108.stny.res.rr.com)
mfaucet2 + pts/87       2012-04-01 14:36   .         14073 (189.sub-166-248-14.myvzw.com)
jjohns43 + pts/82       2012-02-27 11:03 08:45       26118 (cpe-74-65-82-173:S.0)
jjohns43 + pts/93       2012-02-27 11:13 08:45       26196 (cpe-74-65-82-173:S.0)
lab46:~$

Keyword "tty"

Definition

The command “tty” prints the file name of the terminal connected to the standard input

Demonstration
lab46:~$ tty
/dev/pts/87
lab46:~$

Keyword "mesg"

Definition

The “mesg” command without y or n displays whether messaging to the user is available. With mesg y mesg is turned on. With mesg n mesg is turned off.

Demonstration
lab46:~$ mesg
is y
lab46:~$ mesg n
lab46:~$ mesg
is n
lab46:~$ mesg y
lab46:~$ mesg
is y
lab46:~$

Keyword ctrl + C

Definition

Stops a command from running.

Demonstration
lab46:~$ cat
^C
lab46:~$

Keyword "/dev/null"

Definition

A directory where anything unneeded can be piped to.

Demonstration
lab46:/$ find / -name "hello" 2> /dev/null
/home/mfaucet2/devel/hello
/home/bkenne11/hello
/home/bkenne11/devel/hello
/var/public/unix/patterns/hello
/var/public/unix/scripting/hello
/var/public/cs265/hello
/var/public/cs265/hello/hello
/usr/share/doc/libtcltk-ruby1.9.1/examples/demos-en/hello
/usr/share/doc/libtcltk-ruby1.9.1/examples/demos-jp/hello
/usr/share/doc/tk8.4/examples/hello
lab46:/$

Keyword "gcc"

Definition

gcc is a command that compiles code in C.

Demonstration
lab46:~/devel$ gcc -o test test.c
lab46:~/devel$ ls
test test.c
lab46:~/devel$

Keyword "chmod

Definition

The command “chmod” changes the permissions of a file or directory. This command is needed to make a script usable.

Demonstration
lab46:~/scripts$ ls
guess.sh
lab46:~/scripts$ ./guess.sh
-bash: ./guess.sh: Permission denied
lab46:~/scripts$ chmod -c 755 guess.sh
mode of `guess.sh' changed to 0755 (rwxr-xr-x)
lab46:~/scripts$ ./guess.sh
hello
lab46:~/scripts$

unix Objective

Objective

To learn more about how Unix functions and learn the commands to help make everyday work easier.

Definition

The easiest way to find out the functions of Unix is to play around with them. Some help with work that needs to be done and other help make the experience more enjoyable. All around Unix just helps makes doing things easier.

Method

In order to help me achieve higher learning in Unix i will have to do the assignments for the Unix Fundamentals class. In order to do these I will have to be fully engaged in critical thinking and completely indulged in the work that needs to be done.

Measurement

After following my method of achieving higher learning in Unix I have now understood the most recently due assignments after learning how Unix commands work. To achieve this I did what my method said and have handed in my assignments on time.

Analysis

The keywords in the above part of the opus are commands that I have become more familiar with and are more comfortable using those commands without making a huge mess in my virtual machine, like I was when the class first started out.

Experiments

Experiment 4

Question

Can I run more then 1 command at a time?

Resources

None

Hypothesis

I believe I should be able to run more than one command through the use of “;”

Experiment

I am going to show what is in the current home directory, make a file, show the file made in the home directory, then remove the directory all at the same time, without using a script.

Data

lab46:~$ ls;touch file;ls;rm file;ls
Maildir  devel    messaround  phenny          public_html  scripts
compat   labwork  multifile   phenny.tar.bz2  restart.sh   src
Maildir  devel  labwork     multifile  phenny.tar.bz2  restart.sh  src
compat   file   messaround  phenny     public_html     scripts
rm: remove regular empty file `file'? yes
Maildir  devel    messaround  phenny          public_html  scripts
compat   labwork  multifile   phenny.tar.bz2  restart.sh   src
lab46:~$

Analysis

My hypothesis was correct and my hypothesis was applicable. There isn't more than I originally thought.

Conclusions

I discovered that if a user wants to run more than one command at a time, the use of “;” is needed to accomplish such task.

Experiment 5

Question

Can I access any other users home directory? And if not can I change those permissions?

Resources

None

Hypothesis

I believe I won't be able to access any other users home directory because I am not the system administrator or the creator of that directory. Files that I don't have access to I won't have the permission to change the permissions.

Experiment

I am going to use a random student's directory, besides my own, and see if i can access it through using the “cd” command. If I can not I will try to change that students permissions to 755 using “chmod”

Data

lab46:/home$ cd mmatt
-bash: cd: mmatt: Permission denied
lab46:/home$ chmod -c 755 mmatt
chmod: changing permissions of `mmatt': Operation not permitted
lab46:/home$

Analysis

My hypothesis was correct and applicable.

Conclusions

What I found out from the experiment is that because I do not have rights to open the directory I don't have rights to change my rights/permissions that doesn't belong to me using chmod.

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.

Resources

Evaluate their resources and commentary. Answer the following questions:

Hypothesis

State their experiment's hypothesis. Answer the following questions:

Experiment

Follow the steps given to recreate the original experiment. Answer the following questions:

Data

Publish the data you have gained from your performing of the experiment here.

Analysis

Answer the following:

Conclusions

Answer the following: