SlideShare a Scribd company logo
Running Head: Key Assignment 1
CS126-1401A-01: Unix Fundamentals
Key Assignment
Adrianne Crystal Reyes
February 10th, 2014
KeyAssignment 2
Table of Contents
Table of Contents............................................................................................................................ 2
Section 1: Introduction to UNIX..................................................................................................... 3
Section 2: Files................................................................................................................................ 7
Section 3: Users, Groups, and Processes ...................................................................................... 13
Section 4: UNIX File Systems...................................................................................................... 14
Section 5: Shell Scripts ................................................................................................................. 17
Section 6: Linux + Prep Toolkit.................................................................................................... 19
References..................................................................................................................................... 25
KeyAssignment 3
Section 1: Introduction to UNIX
The company covered in this document is a commercial bank involved in the processing
of credit card transactions. Some of the needs of the company are security, encryption, and
multiple end users as well as multiple developers. Theoretically, the company would be using a
secure version of Linux, such as the Red Hat distribution.
Help with Linux
1. Log-in and Log-out
a. For Log-in, simply type in login, then you will be prompted for your user ID and
password.
b. For log-out, type logout and press enter and you will be logged out. Alternatively,
you can also type exit and it will shut down.
2. Common navigations
a. log-in
i. For Log-in, simply type in login, then you will be prompted for your user
ID and password.
b. log-out
i. For log-out, type logout and press enter and you will be logged out.
Alternatively, you can also type exit and it will shut down.
c. cd
i. This command will change directories.
ii. cd bin changes the bin directory in the current directory.
KeyAssignment 4
iii. cd/user/bin changes the bin directory from anywhere in the file system.
d. pwd
i. Show the present working directory.
e. whoami
i. Displays the current username.
f. uname
i. This will displays the system information.
ii. –a displays all system information
iii. –o displays the operating system
iv. –p displays the processor’s architecture type.
g. su
i. Switches the users in the shell.
h. exit
i. Exit the shell.
i. exec
i. Executes a file.
j. ls
i. Shows the names of files and directories in the current directory.
ii. –a shows all files and directories, including hidden files.
iii. –l shows information about files including size, permissions, owner, and
modified date.
k. history
i. See the history of commands.
KeyAssignment 5
ii. –c clears the history list.
l. clear
i. Clears the shell screen.
m. chsh
i. Changes the default shell.
ii. –s changes to a different installed shell and prompts for a password.
iii. –l lists all installed shells.
For assistance at any point in the terminal, a user can type the following commands and get on
screen help.
n. man
i. This option allows the user to see the manual. man man displays a
o. Help
i. Display’s on-screen help section.
p. –help
i. Used with a command like pwd –help, will display the help associated
with a command for more information.
3. Some of the basic Linux shells are; bash (bourne-again), sh (an earlier version of bash),
ksh (korn shell), csh (shell based on c language), and tcsh ( a T/C shell). For my
company, I would recommend a zsh shell be cause it is like the higher programming
languages in that it combines a lot of the power and versatility of its predecessors
combined.
4. There are two different file paths; absolute and relative. An absolute file path is the
entirety of the where a file is located starting from the root file/directory. This might be
KeyAssignment 6
useful for deleting certain things or trying to merge or link files. Relative file path is the
path relative to the current default directory. This is very useful when a user is working
only with the current directory. This can make work go by faster than having to type out
the whole directory.
a. Example of absolute file path:
i. /home/areyes/mydocs
b. Example of relative file path:
i. Mydocs (assuming that the user is already in /home/areyes)
KeyAssignment 7
Section 2: Files
This banking company would have a file directory system structured in such a way that
there are multiple files that would remain the same, but be accessed by multiple users. For
example, a web based information system. The Linux system is different than Windows because
it uses a “/” forward slash as opposed to a “” back slash which Linux uses to mark its files.
Linux utilizes the forward slash to denote to root users . Something to always be aware of.
Before creating the directories for the company, I want to check to make sure that they do
not already exist. I will be using an absolute file path call. I can do this or I can also do a
./pathname to find out if these exist. My directory currently exists as the following four
directories with three sub-directories each; IT (testing, code versions, projects), Customer
Service (manuals, call logs, escalation), Technical support (tech manuals, escalation, test), and
Acquiring (sales, boarding, implementation). So before I create each directory, I can do a call
such as ./bank_credit_aquirer/IT or /home/bank_credit_aquirer/IT. If these are not found either a
blank line will show up or no directory found.
In the cases of my parent directories; IT, Customer Service, Technical Support, and
Acquiring, I will create these as parent directories as the screen shots below demonstrate.
KeyAssignment 8
This last screenshot shows that all of my parent directories have been created, so now I
can go in and make my sub-directories.
KeyAssignment 9
As you can see, I have now created all of these sub-directories. I’ve also thrown in an example of
what would happen if one were to try to create the directory again without having check to see if
it existed yet or not. The next part will show how Linux can be used to create links with
directories.
KeyAssignment 10
Links are a type of file that is a reference to another file or directory. The two types of
links are symbolic and hard. Symbolic links are like a path name that refers to the location of a
file. A hard link refers to the specific location and hard links can only be done by the super user
(Nix Craft, 2007). Two things to keep in mind is what would happen if the target directory does
not exist and how we can determine whether the soft links to not exist before you create them.
When you look at the screenshot, pay attention to the top two directories, I did a simple ls
command to show the directories.
Do you see what I did there? I actually created the symbolic links for Acquiring sales
linked to the main directory. I also misspelled one so it created another one because Linux is case
sensitive with file names. In the next example you can see how I created my link for the IT
directory.
KeyAssignment 11
This last screenshot shows what happens when you create a link for a directory that does not
exist. I do not have a babs directory, however it went ahead and created a link for this. As you
KeyAssignment 12
can see it isn’t a directory because there isn’t a full file name when I search the files and
directories.
KeyAssignment 13
Section 3: Users, Groups, and Processes
Some of the commands to create a user group for each of my four main directories will
be ls –l to see all the directories and access in the directories, which I will show in screenshots. I
will also be using chmod to modifie file access rights, chown, and chgrp. Normally I would use a
su to switch to superuser, however, as I am using an emulator, I do not require the use of this.
KeyAssignment 14
Section 4: UNIX File Systems
In this section we will discuss file permissions and whom is set to access what. In our
company; the file directories are set up so that the file owner can read modify and access the
company directories, group members can read and access the company directories, and everyone
else has no access. In the screenshot below you can see directories and two files that were
created. We will be referencing these throughout the rest of this section.
KeyAssignment 15
The highlighted line is a sample directory containing a readme.txt file. Since my UNIX emulator
decided not to respond to any typical commands, I will be describing how I would normally go
about creating users and assigning them certain access to files.
To begin with, I will need to create the users that will be accessing this file. Each
directory will have two different end users. One will be the manager with full access as the
owner, the second will be a general owner with limited access. There is a third of sorts, it would
be the users of one directory cannot access the directory of another because it is all on a need to
know basis for security purposes.
1. Useradd AcquiringManager
2. Useradd AcquiringDataEntry
3. Useradd ITManager
KeyAssignment 16
4. Useradd ITTester
5. Useradd CSManager
6. Useradd CSRep
7. Useradd TechsupportManager
8. Useradd TechSupportRep
Now that these users are all created we can now modify owners and user access to files and
directories. First we will begin with owners and then directory and file access.
1. Chown /Acquiring –AcquiringManager readme.txt
2. Chown /IT –ITManager readme.txt
And so on until all of these are created for each directory owner, which in this case is the
manager of each department. Our next step is to modify file permissions.
drwxr-xr-x+ 1 Adrianne None 0 Feb 3 12:17 bank_credit_aquirerAcquiringimplementation
In this case this directory (it could also be a file for our readme’s if it had a c instead of a
d at the beginning); we can see rwx for the user permission which is read, write, execute; group
access is set to r-x or read and execute, but not write; and other access is set to read and execute.
These are mostly okay, but we need to remove the other user permission. To accomplish this, we
will change the last r-x to – or no access. To overcome the problem of customer service and
technical support needing to share manuals, we will make them a part of only the group
directories for the manual directories, not any of the others for the other group.
KeyAssignment 17
Section 5: Shell Scripts
In order to automate the creation and processing of; directories and subdirectories, files in
each directories, symbolic links from 2 subdirectories to their parent directories and setting
appropriate file permissions for directories we will need to create a shell script and use pipes and
redirection commands that are run in the script (shell script if we want).
#!/bin/sh
To be totally and completely honest, I cannot motivate myself enough to accomplish the task at
hand. I feel that I haven’t learned enough in such a short time frame to really learn how to
administrate a Linux/Unix system like the one at work. I’m a kinesthetic learner and after just a
little bit of real world application of using it I pick things up pretty quick. I’m going to take the
next two quarters off from school to build my computer science portfolio in addition to a video
resume and a Prezi resume. This entire process will be producing a great outcome. I stand out
from the crowd, I get applicable demonstrations of my abilities shown on my website, and I get
real world experience for an intern or entry level position. I will be working with HTML5 and
CSS, Linux, some gaming SDKs, APIs, etc. Maybe then, with such a demonstration, I can get an
KeyAssignment 18
internship with our IT department helping to remotely manage the Linux system. I’m not proud
of my writing here. I know it is pathetic and I’m disappointed in myself. I really do love Linux,
but I feel that this 5 and ½ week course is a deprivation of something very important in any
company.
KeyAssignment 19
Section 6: Linux + Prep Toolkit
KeyAssignment 20
KeyAssignment 21
KeyAssignment 22
KeyAssignment 23
KeyAssignment 24
KeyAssignment 25
References
Allan, I. D. (2012, December 24). Unix/Linux Pathnames. Retrieved from Ian D. Allan Personal
Home Page: http://teaching.idallen.com/cst8207/12f/notes/160_pathnames.html
Nix Craft. (2007, September 25). How to: Linux / UNIX create soft link with ln command.
Retrieved from nixCraft: http://www.cyberciti.biz/faq/creating-soft-link-or-symbolic-
link/
Riley, L. A. (2010, June 8). A Quick Unix/Linux Tutorial. Retrieved from Ursinus College:
http://webpages.ursinus.edu/lriley/doc/unix/unix_tutorial/unix_tutorial.html

More Related Content

PPT
Basics of unix
PPT
Vistaceic2007 from CEIC 2007
PPT
4.6 create and change hard and symbolic links v2
PDF
Sysinternals utilities : a brief introduction to
PPT
Edubooktraining
PDF
Linux filesystem-hierarchy
PPT
Os10
PPT
Registry forensics
Basics of unix
Vistaceic2007 from CEIC 2007
4.6 create and change hard and symbolic links v2
Sysinternals utilities : a brief introduction to
Edubooktraining
Linux filesystem-hierarchy
Os10
Registry forensics

Viewers also liked (6)

PPTX
Tips for more effective communication
PDF
Awards and Achievements - 2013
PPTX
González valentín presentación_competic2
PPTX
PDF
Escrito improcedencia del abandono
DOCX
Ejercicios para trabajo de MRU
Tips for more effective communication
Awards and Achievements - 2013
González valentín presentación_competic2
Escrito improcedencia del abandono
Ejercicios para trabajo de MRU
Ad

Similar to Unix Work (20)

DOC
58518522 study-aix
PPT
Unix fundamentals
PPS
QSpiders - Unix Operating Systems and Commands
PPT
Linuxnishustud
PPTX
Linux Basics.pptx
PPT
Linux Administration
PPT
Linux Administration
PPT
Unix/Linux Basic Commands and Shell Script
DOC
PPTX
Unix training session 1
PPT
unix.ppt
RTF
A basic unix overview(2)
PDF
Linux Basics
PPT
Online Training in Unix Linux Shell Scripting in Hyderabad
PDF
Command Line Tools
PPTX
Chapter 2 Linux File System and net.pptx
PDF
Presentation aix basic
PPT
Learning Linux v2.1
PPTX
Red hat linux essentials
PDF
Introduction to Linux with Focus on Raspberry Pi
58518522 study-aix
Unix fundamentals
QSpiders - Unix Operating Systems and Commands
Linuxnishustud
Linux Basics.pptx
Linux Administration
Linux Administration
Unix/Linux Basic Commands and Shell Script
Unix training session 1
unix.ppt
A basic unix overview(2)
Linux Basics
Online Training in Unix Linux Shell Scripting in Hyderabad
Command Line Tools
Chapter 2 Linux File System and net.pptx
Presentation aix basic
Learning Linux v2.1
Red hat linux essentials
Introduction to Linux with Focus on Raspberry Pi
Ad

Unix Work

  • 1. Running Head: Key Assignment 1 CS126-1401A-01: Unix Fundamentals Key Assignment Adrianne Crystal Reyes February 10th, 2014
  • 2. KeyAssignment 2 Table of Contents Table of Contents............................................................................................................................ 2 Section 1: Introduction to UNIX..................................................................................................... 3 Section 2: Files................................................................................................................................ 7 Section 3: Users, Groups, and Processes ...................................................................................... 13 Section 4: UNIX File Systems...................................................................................................... 14 Section 5: Shell Scripts ................................................................................................................. 17 Section 6: Linux + Prep Toolkit.................................................................................................... 19 References..................................................................................................................................... 25
  • 3. KeyAssignment 3 Section 1: Introduction to UNIX The company covered in this document is a commercial bank involved in the processing of credit card transactions. Some of the needs of the company are security, encryption, and multiple end users as well as multiple developers. Theoretically, the company would be using a secure version of Linux, such as the Red Hat distribution. Help with Linux 1. Log-in and Log-out a. For Log-in, simply type in login, then you will be prompted for your user ID and password. b. For log-out, type logout and press enter and you will be logged out. Alternatively, you can also type exit and it will shut down. 2. Common navigations a. log-in i. For Log-in, simply type in login, then you will be prompted for your user ID and password. b. log-out i. For log-out, type logout and press enter and you will be logged out. Alternatively, you can also type exit and it will shut down. c. cd i. This command will change directories. ii. cd bin changes the bin directory in the current directory.
  • 4. KeyAssignment 4 iii. cd/user/bin changes the bin directory from anywhere in the file system. d. pwd i. Show the present working directory. e. whoami i. Displays the current username. f. uname i. This will displays the system information. ii. –a displays all system information iii. –o displays the operating system iv. –p displays the processor’s architecture type. g. su i. Switches the users in the shell. h. exit i. Exit the shell. i. exec i. Executes a file. j. ls i. Shows the names of files and directories in the current directory. ii. –a shows all files and directories, including hidden files. iii. –l shows information about files including size, permissions, owner, and modified date. k. history i. See the history of commands.
  • 5. KeyAssignment 5 ii. –c clears the history list. l. clear i. Clears the shell screen. m. chsh i. Changes the default shell. ii. –s changes to a different installed shell and prompts for a password. iii. –l lists all installed shells. For assistance at any point in the terminal, a user can type the following commands and get on screen help. n. man i. This option allows the user to see the manual. man man displays a o. Help i. Display’s on-screen help section. p. –help i. Used with a command like pwd –help, will display the help associated with a command for more information. 3. Some of the basic Linux shells are; bash (bourne-again), sh (an earlier version of bash), ksh (korn shell), csh (shell based on c language), and tcsh ( a T/C shell). For my company, I would recommend a zsh shell be cause it is like the higher programming languages in that it combines a lot of the power and versatility of its predecessors combined. 4. There are two different file paths; absolute and relative. An absolute file path is the entirety of the where a file is located starting from the root file/directory. This might be
  • 6. KeyAssignment 6 useful for deleting certain things or trying to merge or link files. Relative file path is the path relative to the current default directory. This is very useful when a user is working only with the current directory. This can make work go by faster than having to type out the whole directory. a. Example of absolute file path: i. /home/areyes/mydocs b. Example of relative file path: i. Mydocs (assuming that the user is already in /home/areyes)
  • 7. KeyAssignment 7 Section 2: Files This banking company would have a file directory system structured in such a way that there are multiple files that would remain the same, but be accessed by multiple users. For example, a web based information system. The Linux system is different than Windows because it uses a “/” forward slash as opposed to a “” back slash which Linux uses to mark its files. Linux utilizes the forward slash to denote to root users . Something to always be aware of. Before creating the directories for the company, I want to check to make sure that they do not already exist. I will be using an absolute file path call. I can do this or I can also do a ./pathname to find out if these exist. My directory currently exists as the following four directories with three sub-directories each; IT (testing, code versions, projects), Customer Service (manuals, call logs, escalation), Technical support (tech manuals, escalation, test), and Acquiring (sales, boarding, implementation). So before I create each directory, I can do a call such as ./bank_credit_aquirer/IT or /home/bank_credit_aquirer/IT. If these are not found either a blank line will show up or no directory found. In the cases of my parent directories; IT, Customer Service, Technical Support, and Acquiring, I will create these as parent directories as the screen shots below demonstrate.
  • 8. KeyAssignment 8 This last screenshot shows that all of my parent directories have been created, so now I can go in and make my sub-directories.
  • 9. KeyAssignment 9 As you can see, I have now created all of these sub-directories. I’ve also thrown in an example of what would happen if one were to try to create the directory again without having check to see if it existed yet or not. The next part will show how Linux can be used to create links with directories.
  • 10. KeyAssignment 10 Links are a type of file that is a reference to another file or directory. The two types of links are symbolic and hard. Symbolic links are like a path name that refers to the location of a file. A hard link refers to the specific location and hard links can only be done by the super user (Nix Craft, 2007). Two things to keep in mind is what would happen if the target directory does not exist and how we can determine whether the soft links to not exist before you create them. When you look at the screenshot, pay attention to the top two directories, I did a simple ls command to show the directories. Do you see what I did there? I actually created the symbolic links for Acquiring sales linked to the main directory. I also misspelled one so it created another one because Linux is case sensitive with file names. In the next example you can see how I created my link for the IT directory.
  • 11. KeyAssignment 11 This last screenshot shows what happens when you create a link for a directory that does not exist. I do not have a babs directory, however it went ahead and created a link for this. As you
  • 12. KeyAssignment 12 can see it isn’t a directory because there isn’t a full file name when I search the files and directories.
  • 13. KeyAssignment 13 Section 3: Users, Groups, and Processes Some of the commands to create a user group for each of my four main directories will be ls –l to see all the directories and access in the directories, which I will show in screenshots. I will also be using chmod to modifie file access rights, chown, and chgrp. Normally I would use a su to switch to superuser, however, as I am using an emulator, I do not require the use of this.
  • 14. KeyAssignment 14 Section 4: UNIX File Systems In this section we will discuss file permissions and whom is set to access what. In our company; the file directories are set up so that the file owner can read modify and access the company directories, group members can read and access the company directories, and everyone else has no access. In the screenshot below you can see directories and two files that were created. We will be referencing these throughout the rest of this section.
  • 15. KeyAssignment 15 The highlighted line is a sample directory containing a readme.txt file. Since my UNIX emulator decided not to respond to any typical commands, I will be describing how I would normally go about creating users and assigning them certain access to files. To begin with, I will need to create the users that will be accessing this file. Each directory will have two different end users. One will be the manager with full access as the owner, the second will be a general owner with limited access. There is a third of sorts, it would be the users of one directory cannot access the directory of another because it is all on a need to know basis for security purposes. 1. Useradd AcquiringManager 2. Useradd AcquiringDataEntry 3. Useradd ITManager
  • 16. KeyAssignment 16 4. Useradd ITTester 5. Useradd CSManager 6. Useradd CSRep 7. Useradd TechsupportManager 8. Useradd TechSupportRep Now that these users are all created we can now modify owners and user access to files and directories. First we will begin with owners and then directory and file access. 1. Chown /Acquiring –AcquiringManager readme.txt 2. Chown /IT –ITManager readme.txt And so on until all of these are created for each directory owner, which in this case is the manager of each department. Our next step is to modify file permissions. drwxr-xr-x+ 1 Adrianne None 0 Feb 3 12:17 bank_credit_aquirerAcquiringimplementation In this case this directory (it could also be a file for our readme’s if it had a c instead of a d at the beginning); we can see rwx for the user permission which is read, write, execute; group access is set to r-x or read and execute, but not write; and other access is set to read and execute. These are mostly okay, but we need to remove the other user permission. To accomplish this, we will change the last r-x to – or no access. To overcome the problem of customer service and technical support needing to share manuals, we will make them a part of only the group directories for the manual directories, not any of the others for the other group.
  • 17. KeyAssignment 17 Section 5: Shell Scripts In order to automate the creation and processing of; directories and subdirectories, files in each directories, symbolic links from 2 subdirectories to their parent directories and setting appropriate file permissions for directories we will need to create a shell script and use pipes and redirection commands that are run in the script (shell script if we want). #!/bin/sh To be totally and completely honest, I cannot motivate myself enough to accomplish the task at hand. I feel that I haven’t learned enough in such a short time frame to really learn how to administrate a Linux/Unix system like the one at work. I’m a kinesthetic learner and after just a little bit of real world application of using it I pick things up pretty quick. I’m going to take the next two quarters off from school to build my computer science portfolio in addition to a video resume and a Prezi resume. This entire process will be producing a great outcome. I stand out from the crowd, I get applicable demonstrations of my abilities shown on my website, and I get real world experience for an intern or entry level position. I will be working with HTML5 and CSS, Linux, some gaming SDKs, APIs, etc. Maybe then, with such a demonstration, I can get an
  • 18. KeyAssignment 18 internship with our IT department helping to remotely manage the Linux system. I’m not proud of my writing here. I know it is pathetic and I’m disappointed in myself. I really do love Linux, but I feel that this 5 and ½ week course is a deprivation of something very important in any company.
  • 19. KeyAssignment 19 Section 6: Linux + Prep Toolkit
  • 25. KeyAssignment 25 References Allan, I. D. (2012, December 24). Unix/Linux Pathnames. Retrieved from Ian D. Allan Personal Home Page: http://teaching.idallen.com/cst8207/12f/notes/160_pathnames.html Nix Craft. (2007, September 25). How to: Linux / UNIX create soft link with ln command. Retrieved from nixCraft: http://www.cyberciti.biz/faq/creating-soft-link-or-symbolic- link/ Riley, L. A. (2010, June 8). A Quick Unix/Linux Tutorial. Retrieved from Ursinus College: http://webpages.ursinus.edu/lriley/doc/unix/unix_tutorial/unix_tutorial.html