Mason Faucett 2012 Unix/Linux Fundamentals Opus
MAJOR: Computer Science
Hello all, my name is Mason Faucett and i'm here to learn a lot more about UNIX/LINUX than i know already. With this online course and the book i have hopefully i will achieve that goal. A little bit about me is that i'm 18, and i love computers, or anything electronic really. I'm a fast learner so my Boces instructor said. I've taken Computer Essentials and Network Fundamentals in Boces and I am Network+ and A+ certified for life. If you have any questions about computers or what they can do ask me i'll gladly try my hardest to find an answer. I'm not mean at all and i'm a pretty easy going person. I am shy so if you wanna talk to me in public you might have to start up the conversation.
Today I experienced some trouble with the Class Chat. The ctrl + a release both tap d wasn't working on my original chat so i made a new one. With the new chat up I first tested that i could detatch from the chat with ctrl + a release both tap d and it worked so i was happy. But sadly, when i reattched to the chat i realized i couldn't type anything. So after again making a new one that works correctly now i still can't get rid of the one that i can't type /quit in. Hopefully the answer will dawn upon me sooner than later but having to take the long way into talking to my class mates is well worth it for their help.
Today Wedge helped me learn a new command “the 'kill' command”. A little bit about the “kill” command: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec … or kill -l [sigspec]. What the kill command does is that it your having trouble with a bash (like i was with the screen) you issue this command to terminate the process. The reason why it was related to the course is because that I was having trouble with my screen that i couldn't do anything in. After wedge issued the kill command on the process I didn't have to use screen -r 23478 to re-attatch myself to the classroom chat screen that worked. Maybe the kill command can help you guys out if you have a troublesome bash.
This is my attempt to make an ASCII tree of my home directory.
Lately the labs and case studies have been easier to understand. I don't really know why but I think it's because the way I have been thinking lately (more out of the box) has really helped in figuring out the “puzzles” in the labs. I don't really know much of languages but I have been learning on how to write in pseudocode (←-sp?) and if it doesn't make any sense to anybody let me know and i will try and make it more clear to them.
My definition of the command “cd” is that it is an abbreviation of change directory. With just the command “cd” it will, by default, change the directory to the home directory. If the command “cd src” is used then the directory will be changed (like in the demonstration). With the command “cd ..” the directory will go to the one previous the one it is currently in. (as shown in the demonstration again). Also the command cd can be used to change to directories in directories such as my example, “cd src/src/unix” which will take my directory and change it to “lab46:~/src/src/unix$”
lab46:~$ cd src lab46:~/src$ cd .. lab46:~$ cd src/src/unix lab46:~/src/src/unix$
The command “pwd” means that it will show the path that the current working directory is in. The directory path to the home directory, for me, is “/home/mfaucet2”. As the command “cd” is used the pwd output is either longer or shorter.
Demonstration of the chosen keyword.
lab46:~$ pwd /home/mfaucet2 lab46:~$ cd src lab46:~/src$ pwd /home/mfaucet2/src lab46:~/src$ cd /home/mfaucet2 lab46:~$ pwd /home/mfaucet2 lab46:~$ cd .. lab46:/home$ pwd /home lab46:/home$ cd .. lab46:/$ pwd / lab46:/$
The “mv” command is just a sorter way to say move. The “mv” command has two functions; One function is to move the command (obviously). The second function is to rename the file/directory/archive/what-ever. A way that I found to use the “mv” command is the following: mv “filename” -t (I think “-t” is “to”) “new filename or new directory location” and voila the file is moved.
Demonstration of the chosen keyword.
lab46:~$ ls Maildir badname file.txt.gz shell archive1.tar.gz badname.tar.gz lab2 src archive2.zip courses.html lyrics.mp3 src.bak archives **example.txt** public_html the answer.txt lab46:~$ mv example.txt example1.txt lab46:~$ ls Maildir badname file.txt.gz shell archive1.tar.gz badname.tar.gz lab2 src archive2.zip courses.html lyrics.mp3 src.bak archives **example1.txt** public_html the answer.txt lab46:~$ mv example1.txt -t src lab46:~$ ls Maildir archives courses.html lyrics.mp3 src archive1.tar.gz badname file.txt.gz public_html src.bak archive2.zip badname.tar.gz lab2 shell the answer.txt lab46:~$ cd src lab46:~/src$ ls **example1.txt** src lab46:~/src$
“touch” isn't touching a file or directory or archive. The command “touch” is how files are created. Using the “touch” command can be used to create 1 - x amount of files all in the same command.
Demonstration of the chosen keyword.
lab46:~/messaround$ touch example.txt lab46:~/messaround$ ls example.txt lab46:~/messaround$ touch example1.txt example2.txt example3.txt lab46:~/messaround$ ls example.txt example1.txt example2.txt example3.txt lab46:~/messaround$
“motd” is the message of the day. It is displayed after the user logs in or after using the command “motd”.
lab46:~$ motd __ _ _ _ __ . . . . . . . . . . . . . . . . . . . . . . . . . | | __ _| |__ / | |_/ / . Basic System Usage: Type 'usage' at prompt . | |__/ _` | '_ \\_ _/ _ \ . Events and News: Type 'news' at prompt . |_____\__,_|_.__/ |_|\___/ . Broken E-mail? Type 'fixmail' at prompt . --------------------------- . Check Lab46 Mail: Type 'alpine' at prompt . c o r n i n g - c c . e d u . . . . . . . . . . . . . . . . . . . . . . . . . Lab46 is the Computer & Information Science Department's Student Development Server for Computer-related coursework, projects, and exploration. For more information, please check out: .. . . . . . . . . . .. . Lab46 Web Page: http://lab46.corning-cc.edu/ . . Lab46 Help Form: http://lab46.corning-cc.edu/help_request . . Help E-mail: haas@corning-cc.edu or wedge@lab46.corning-cc.edu . .. . . . . . . . . . .. lab46:~$
Another way to logout, or exiting a screen.
Demonstration of the chosen keyword.
lab46:~$ screen -r [detached from 23478.pts-5.lab46] lab46:~$
lab46:~$ logout
The above is what it shown in a split second after pressing “ctrl a + d”
A simple way to enter a irssi chat after setting one up.
Demonstration of the chosen keyword.
lab46:~$ screen -ls There is a screen on: 23478.pts-5.lab46 (01/24/2012 12:43:26 PM) (Detached) 1 Socket in /var/run/screen/S-mfaucet2. lab46:~$ screen -r 23478 [detached from 23478.pts-5.lab46] lab46:~$ screen -ls There is a screen on: 23478.pts-5.lab46 (01/24/2012 12:43:26 PM) (Detached) 1 Socket in /var/run/screen/S-mfaucet2. lab46:~$ screen -d There is a screen on: 23478.pts-5.lab46 (01/24/2012 12:43:25 PM) (Detached) There is no screen to be detached. lab46:~$
My definition of “alpine” is the Unix mailing system.
ALPINE 2.00 MAIN MENU Folder: INBOX 14 Messages + ? HELP - Get help using Alpine C COMPOSE MESSAGE - Compose and send a message I MESSAGE INDEX - View messages in current folder L FOLDER LIST - Select a folder to view A ADDRESS BOOK - Update address book S SETUP - Configure Alpine Options Q QUIT - Leave the Alpine program Copyright 2006-2008 University of Washington [Folder "INBOX" opened with 14 messages] ? Help P PrevCmd R RelNotes O OTHER CMDS > [ListFldrs] N NextCmd K KBLock
To learn more about how Unix functions and learn the commands to help make everyday work easier.
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.
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.
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.
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.
Can I remove more than 1 file while using the “rm” command?
None used
I believe that I can remove more than 1 file at a time using the “rm” command because with the “touch” command I can create more files with 1 command.
I have already created files using the touch command and I will use the rm command to see if i can remove them all at once.
lab46:~/messaround$ ls example.txt example1.txt example2.txt example3.txt lab46:~/messaround$ rm example.txt example1.txt example2.txt example3.txt rm: remove regular empty file `example.txt'? yes rm: remove regular empty file `example1.txt'? yes rm: remove regular empty file `example2.txt'? yes rm: remove regular empty file `example3.txt'? yes lab46:~/messaround$ ls lab46:~/messaround$
My hypothesis was correct and through typing the file names after the first I was prompted to delete them all, but it was still prompting me one at a time for each file.
I have discovered that the touch command along with the rm command have some similarities with each other in that they can both manipulate multiple files at once.
Am I able to remove a directory while it still has files in it?
None used
I believe I will be able to remove the directory that has files in it because it would be like removing a folder in a GUI environment, where if it has files in it the user would just be prompted if he/she would want to remove the folder or in a CLI enviroment a directory.
I have a mess around directory that has nothing important in it and have four files that are blank. After using the rmdir command on /messaround hopefully the directory will be removed.
lab46:~/messaround$ ls example.txt example1.txt example2.txt example3.txt lab46:~/messaround$ cd .. lab46:~$ rmdir messaround rmdir: failed to remove `messaround': Directory not empty lab46:~$
My hypothesis was incorrect. The directories in a cli are different than folders in a gui environment; tho they have the same purpose.
I have found that in order to remove a directory, whatever is in it must also be removed in order to remove the directory.
Can I attach to an active screen?
None used
I don't believe I can attach to an active screen, because I'm technically already on it. i would have to detach myself then reattach myself to the screen.
I'm going to exit out of the screen by exiting my virtual machine and seeing if the screen is attached. If it is I can further go the experiment by using screen -r to reattach myself to the screen, if not I will have to use screen -d then screen -r to reattach myself to the screen.
lab46:~$ screen -ls There is a screen on: 23478.pts-5.lab46 (01/24/2012 12:43:26 PM) 1 Socket in /var/run/screen/S-mfaucet2.
lab46:~$ screen -r There is a screen on: 23478.pts-5.lab46 (01/24/2012 12:43:26 PM) (Attached) There is no screen to be resumed. lab46:~$ screen -d [23478.pts-5.lab46 detached.] lab46:~$ screen -ls There is a screen on: 23478.pts-5.lab46 (01/24/2012 12:43:26 PM) (Detached) 1 Socket in /var/run/screen/S-mfaucet2. lab46:~$ screen -r [detached from 23478.pts-5.lab46] lab46:~$
Based on the data collected: My hypothesis was correct as shown above. I could not attach to a attached screen because it was already on. After detaching the screen i was then able to attach myself to the detached screen.
I have learned that screens are like different sections of the server. If they are accessed when somebody is already on their screen they will either have to: make another screen, detach from the active screen and reattach themselves to it, or use screen -x to override the attached screen error.
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.
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.
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.
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.
df locates all of the running directories used by a users system and each directories disk space usage.
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:~$
The who command shows who is currently logged on and if their messaging is on(+) or off(-).
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:~$
The command “tty” prints the file name of the terminal connected to the standard input
lab46:~$ tty /dev/pts/87 lab46:~$
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.
lab46:~$ mesg is y lab46:~$ mesg n lab46:~$ mesg is n lab46:~$ mesg y lab46:~$ mesg is y lab46:~$
Stops a command from running.
lab46:~$ cat ^C lab46:~$
A directory where anything unneeded can be piped to.
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:/$
gcc is a command that compiles code in C.
lab46:~/devel$ gcc -o test test.c lab46:~/devel$ ls test test.c lab46:~/devel$
The command “chmod” changes the permissions of a file or directory. This command is needed to make a script usable.
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$
To learn more about how Unix functions and learn the commands to help make everyday work easier.
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.
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.
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.
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.
Can I run more then 1 command at a time?
None
I believe I should be able to run more than one command through the use of “;”
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.
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:~$
My hypothesis was correct and my hypothesis was applicable. There isn't more than I originally thought.
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.
Can I access any other users home directory? And if not can I change those permissions?
None
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.
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”
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$
My hypothesis was correct and applicable.
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.
Perform the following steps:
Whose existing experiment are you going to retest? Provide the URL, note the author, and restate their question.
Evaluate their resources and commentary. Answer the following questions:
State their experiment's hypothesis. Answer the following questions:
Follow the steps given to recreate the original experiment. Answer the following questions:
Publish the data you have gained from your performing of the experiment here.
Answer the following:
Answer the following:
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
Identification of chosen keyword (unless you update the section heading above).
Definition (in your own words) of the chosen keyword.
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Identification of chosen keyword (unless you update the section heading above).
Definition (in your own words) of the chosen keyword.
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Identification of chosen keyword (unless you update the section heading above).
Definition (in your own words) of the chosen keyword.
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Identification of chosen keyword (unless you update the section heading above).
Definition (in your own words) of the chosen keyword.
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Identification of chosen keyword (unless you update the section heading above).
Definition (in your own words) of the chosen keyword.
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Identification of chosen keyword (unless you update the section heading above).
Definition (in your own words) of the chosen keyword.
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Identification of chosen keyword (unless you update the section heading above).
Definition (in your own words) of the chosen keyword.
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Identification of chosen keyword (unless you update the section heading above).
Definition (in your own words) of the chosen keyword.
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
State the course objective
In your own words, define what that objective entails.
State the method you will use for measuring successful academic/intellectual achievement of this objective.
Follow your method and obtain a measurement. Document the results here.
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
What is the question you'd like to pose for experimentation? State it here.
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.
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.
State your rationale.
How are you going to test your hypothesis? What is the structure of your experiment?
Perform your experiment, and collect/document the results here.
Based on the data collected:
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.
What is the question you'd like to pose for experimentation? State it here.
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.
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.
State your rationale.
How are you going to test your hypothesis? What is the structure of your experiment?
Perform your experiment, and collect/document the results here.
Based on the data collected:
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.
Perform the following steps:
Whose existing experiment are you going to retest? Provide the URL, note the author, and restate their question.
Evaluate their resources and commentary. Answer the following questions:
State their experiment's hypothesis. Answer the following questions:
Follow the steps given to recreate the original experiment. Answer the following questions:
Publish the data you have gained from your performing of the experiment here.
Answer the following:
Answer the following: