19
E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

Embed Size (px)

Citation preview

Page 1: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

Author: Jon Kleppe NTNU

Assistant producer: Joachim Tro

Page 2: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

INTRODUCTION Introduction to UNIX

On the left hand side you are able to determine

where you are in the module. You press the white

arrows at the bottom the to switch between

pages. You can press the buttons on the left side

to flip between subjects.

At the end of this module we recommend that

you try out the quiz as it will enhance your

learning experience

Learning goals

• This module is meant to be an introduction

to the Operating System (OS) UNIX

• You will learn the most basic commands, and when you learn these, you will find UNIX

very easy to use

• Why UNIX? (click to know more..)

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 3: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

Introduction to UNIX

•UNIX is a very powerful and stable operating system.

•System of choice for engineering and scientific work stations.

•Very fit to run heavy applications

•Every computer requires an operating system

•An operating system is the program that controls all the other parts of a computer system, both the hardware and the software. It allocates the computer's resources and schedules tasks.

•UNIX is a multi-user, multi-tasking operating system. Multiple users may have multiple tasks running simultaneously. This is very different from PC operating systems. (e.g. Windows)

Operating system

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 4: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

How to log on

•When you log on to UNIX, we will use the Petra server •On your Start menu, run WebtermX Administrator

•In the Connection List, highlight Petra, and hit Connect

•Log on as you would in Windows

Okay, I’m logged on. Now what?

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 5: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

User Interface

•Here you can find File Manager, Text Editor, Help Function etc

•It is very similar to those in Windows.

When you are logged on the window will look like this.

Press here for more informasjon on the window

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 6: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

User Interface

Name of Server

Command Prompt

•We will now focus on the Terminal Window in UNIX

•This is our workplace for making directories, running programs, deleting files and a million other things

•For this we will use a set of commands

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 7: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

Commands

•UNIX contains several levels of commands

•A command makes something happen, e.g. deletes a file or makes a directory

•All UNIX commands are executed by pressing Enter

Making a directory ”unixfiles”, then deleting it

petra:~:(01)$

petra:~:(02)$cd

unixfilespetra:~/unixfiles(03)$ cd ..petra:~:(04)$ rmdir unixfiles

petra:~:(05)$

mkdir unixfiles

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 8: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

List of commands

cd - change directorypwd - displays present working directoryls - list contents of directorymkdir - make directory rmdir - remove (empty) directoryrm - remove filescp - copy filesmv - move or rename filescat - display fileman - help on a commandclear - clear screen

•Here is a list of commands that will make you able to do basic tasks

•If you allready know some UNIX and want to look at more commands you can check out this link

UNIX - course

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 9: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

List of commmands

Syntax:cd <directory>

Example:cd test

To get back to the previous folder:

cd ..

Terminal window Terminal

window

Syntax:pwd

•Changes directory to test •Displays the pathname of the current working directory

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 10: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

List of commmands

•In the third line at the picture above, the ls command is followed by: *txt. This is called a flag. In this case it lists all txt – files.

•Try ls –l, ls -a

Syntax:ls

Examplels *txt

More about flag

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 11: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

List of commmands

Syntax:mkdir

<directory>

Example:mkdir test2

The directories structure will form out as branches of a tree.

If you make a directory test2 when standing in the directory test, test2 will be located below test in the directory structure, a subdirectory to test

My documents

test

test2

Music

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 12: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

List of commands

Syntaxrmdir <directory>

Example:rmdir test2

•Important: In order to delete a directory, it has to be empty; containing no files or subdirectories

•When you have deleted a directory using rmdir, it is gone for good, there is no way bringing it back (i.e when you delete a directory in windows it goes to the trash bin first, you can recover it later if you want to)

Syntax:rm <filnavn>

Example:rm logo.gif

•Deleting a file called ”logo.gif”:

•As the rmdir command, rm removes the file permanently

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 13: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

List of commands

Syntax:cp <fromFile> <toFile>cp <fromFile> <toDirectory>

In this example, I have copied the file recipe.txt from thedirectory test to test2

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 14: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

List of commands

Syntax:

mv <oldName> <newName>

mv <fromFile> <toDirectory>

Example:

Renaming recipe.txt to muffinrecipe.txt:

mv recipe.txt muffinrecipe.txt

Syntax:cat <filename>

Lists contents of file to screen Other display commands:

more - lists contents of file page by pageless - same as more but includes additional optionshead - displays first 10 lines of filetail - displays last 10 lines of file

Syntax:man <command>

Exampleman cd

This is a very useful command. It explains what the command does and every additional option and argument you may include

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 15: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

List of commands

Syntax:clear

This command clears screen and the window will look like it did when you opened it

•When using UNIX, things will go much more faster if you learn and use the following:

•To switch between previously used commands, use the up and down arrows

•If you f.ex are changing directory to documents, type cd do and hit TAB, then UNIX will fill out the rest of the name itself. If you have several directories that begins with do, UNIX lists all of them if you hit TAB once more

•Do not include special symbols or characters in file-and directory names. Such can be #, å, !, @.

•Do not use file- and directory names with an open space (instead of test file, use testfile or test_file)

Useful info

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 16: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

Resources

As always when it comes to computing and computer related things, there is a large amount of information available on the Web.

These sites may prove useful:

Brukerkurs i UNIX (norwegian)

Introduction to UNIX

UNIX Tutorial Center

Webopedia (english computer encyclopedia)

Dataleksikon (norwegian computer encyclopedia)

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 17: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

Quiz

This section includes a quiz on the topics covered by this module.

The quiz is meant as a control to see if you have learned some of the most important features

Press object to start quiz

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Shockwave Flash Object

Page 18: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

About this module

Title: E-module for UNIX

Author: Jon Kleppe

Assistant producer(s): Joachim Tro with help of Per Jørgen Dahl Svendsen

Size: 1.7 mb

Publication date: 2. January 2002

Abstract: Gives an introducion to Unix for use in Applied Computing in Geoscience and

Petroleum

Software required: PowerPoint XP/XP Viewer

Level: 1

Estimated time to complete: 45 minutes

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES

Page 19: E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro

E-module for UNIX

REFERENCES ABOUT HELPFAQ

On every page, you will find the title at the top, and a menu with the main chapters in bold to the left. These are hyperlinks which enable you choose the chapters in whichever order you wish to view them. Keep in mind that the module is set up in the order the author believes is most appropriate for study. These chapters are also represented with an illustration on the introduction slide linked to the appropriate chapter.

The chapter you are currently viewing in is shown with this marker: , while the subchapter (when applicable) is highlighted in orange.

Within the main frame (the white area), you’ll find text and illustrations as well as animations and videos etc. Many pictures have enlargement buttons near them.

HelpNavigation tools in the module

Previous picture in an animation or sequence of pictures.

Next picture in an animation or sequence of pictures.

At bottom of the slide you’ll find a few standardised buttons which occur on every page (some may not be present in the module):

shows the list of references.

shows information about the module (e.g. author and assistant producer).

shows a list of frequently asked questions if there are any.

takes you to previously viewed slide.

is linked to the previous chapter and slide, respectively.

is linked to the next chapter and slide, respectively.

you may turn off the sound, or turn it on (when available).

you have figured it out!

will end your session with the current module.

If you have any problems, please let us know by sending an e-mail to [email protected]. Please include the title of module and description of the problem. We will respond as quickly as possible.

REFERENCES

ABOUT

EXIT

HELP

ON O F F

FAQ

BACK

INTRODUCTION

LOG ON

USER INTERFACE

COMMANDS

LIST OF COMMANDS

USEFUL INFO

QUIZ

RESOURCES