Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to UNIX donna Bair-Mundy. What is UNIX? Applications OperatingSystem Hardware.

Similar presentations


Presentation on theme: "Introduction to UNIX donna Bair-Mundy. What is UNIX? Applications OperatingSystem Hardware."— Presentation transcript:

1 Introduction to UNIX donna Bair-Mundy

2 What is UNIX? Applications OperatingSystem Hardware

3 Operating system functions Keeps track of types and locations of hardware Intermediary between applications and hardware Maintains directory of files Manages how data is stored Allocates memory to programs

4 User instructions to operating system When to run a program Creating and naming directories Copying files between directories or onto disks Setting access permissions

5 Unix operating system % ls myfile.txt yourfile.txt % Command-line interface Utilities—programs to list files, tell who is on the system, what processes are running, etc. Editors—use to create HTML files for Web portals

6 Unix environment - now host terminals terminals Hi! H i ! H o ! Ho!

7 Unix environment - then host terminals

8 1 subdirectory 18 subdirectory 24 subdirectory UHUNIX file structure bin subdirectory Root directory home subdirectory usr subdirectory johnd Home directory donnab Home directory nahl Home directory

9 Basic UHUNIX commands pwd pwd print working directory tells you where you are in the file hierarchy ls lslist lists files and subdirectories cd cdchange directory Moves you up or down in the file hierarchy chmod chmodchange mode Assigns access rights to files and directories

10 More UHUNIX commands man man manual man + command provides access to electronic help files cp cpcopy cp sourcefile destinationfile copies the source file to a file with the destination file name rm rmremove file Deletes a file mkdir mkdirmake directory Creates a new directory

11 Where am I: pwd (print working directory) % pwd /home/18/donnab %

12 What files and directories do I have: ls (list files) aardvark.txt mail myfile.txt public_html whatsup.doc % % ls

13 The "all files" option: ls -a....addressbook.cshrc.inbox.login.logout.pinerc % ls.signature.ssh2 aardvark.txt mail myfile.txt public_html whatsup.doc % -a

14 The "long' option: ls -l % ls -rw-------1 donnab47616May 8 11:59aardvark.txt drwx------2 donnab 3584Apr 10 2002mail -rw-------1 donnab45927May 8 11:59myfile.txt drwxr-xr-x5 donnab 1024Mar 20 13:51public_html % -l ls -la

15 Changing my working directory: cd (change directory) cdchange directory % cd public_html % pwd /home/18/donnab/public_html % cd fun/images % pwd /home/18/donnab/public_html/fun/images %

16 Changing my working directory: cd cdchange directory %cd public_html fun donnab public_html mail imageshtml files

17 Changing my working directory: cd cdchange directory %cd fun/images fun donnab public_html mail imageshtml files

18 Changing to a higher-level subdirectory: cd.. cd.. % pwd /home/18/donnab/public_html/fun/images % /home/18/donnab/public_html/fun/ % /home/18/donnab/public_html/ % cd /bin cd.. % pwd Note space preceding dots

19 Changing my working directory: cd cdchange directory %cd.. fun donnab public_html mail imageshtml files

20 Changing access rights to a file or directory: chmod (change mode, part 1) % ls -l -rwx------1 donnab47616May 8 11:59myfile.txt drwxr-xr-x5 donnab 1024Mar 20 13:51public_html % r w x - r w x - - - - - - ownergrouppublic

21 Changing access rights to a file or directory: chmod (change mode, part 2) %ls -l -rwx------ 1 donnab 47616May 8 11:59myfile.txt drwxr-xr-x5 donnab 1024Mar 20 13:51public_html % r w x r - x r - x ownergrouppublic chmod755myfile.txt % ls -l -rwxr-xr-x1 donnab47616May 8 11:59myfile.txt drwxr-xr-x5 donnab 1024Mar 20 13:51public_html

22 Binary numbers (part 1) Base 10 110100 127 Base 2 124 111 81632 1111 64

23 Binary numbers (part 2) Base 10 110 00 Base 2 124 000 8 011111123405678901001101000110

24 Binary numbers (part 3) 7 Base 2 124 81632 64 12 4 111 7 - 4 3 - 2 1 ++ = 7 Decimal Base two

25 Binary numbers (part 4) 6 Base 2 124 81632 64 12 4 110 6 - 4 2 - 2 0 4 + 2 + 0 = 6

26 Binary numbers (part 5) 5 Base 2 12 4 011100101 Selection A Selection B Selection C Base 10

27 Oops… 5 Base 2 124 011 2+1=3 Try again

28 Oops… 5 Base 2 124 100 4+0+0 Try again =4

29 Congratulations! 5 Base 2 124 101 4+ 0+ 1= 5 Yes!

30 Changing access rights to a file or directory: chmod (change mode, part 3) % -rwxr-xr-x 1 donnab 47616May 8 11:59myfile.txt drwxr-xr-x 5 donnab 1024Mar 20 13:51public_html % rwx r-x r-x ownergrouppublic chmod 755 myfile.txt 111 101 101 755

31 % Getting help: man command man User Commands chmod(1) NAME chmod - change the permissions mode of a file DESCRIPTION chmod changes or assigns the mode of a file. The mode of a file specifies its permissions and other attributes. … chmod

32 % Getting help: man -k man access access (3f) - return access mode (r,w,x) or existence of a file cggglm cggglm (3p) - solve a general Gauss-Markov linear model (GLM) problem chmod chmod (3f) - change mode of a file dggglm dggglm (3p) - solve a general Gauss-Markov linear model (GLM) problem f77_ieee_environment f77_ieee_environment (3f) - mode, status, and signal handling for IEEE arithmetic fegetprec fesetprec (3m) - control floating point rounding precision modes -kmode|more

33 % Making back-ups: cp (copy) cp % ls myfile.txt myfilebk.txt my file.txt my_file.txt myfile.txtmyfilebk.txt

34 % Deleting a file: rm (remove) rm %ls myfile.txt myfilebk.txt % ls myfile.txt myfilebk.txt rm: remove myfilebk.txt (yes/no)? y

35 % Creating a new subdirectory: mkdir (make directory) mkdir % ls -l drwx------images -rwx------myfile.txt % chmod 755 images images

36 % Logging out of the system: logout logout You are now logged out from the Sun Tue Jul 8 11:20:18 HST 2003


Download ppt "Introduction to UNIX donna Bair-Mundy. What is UNIX? Applications OperatingSystem Hardware."

Similar presentations


Ads by Google