Presentation is loading. Please wait.

Presentation is loading. Please wait.

Department of Computer Engineering

Similar presentations


Presentation on theme: "Department of Computer Engineering"— Presentation transcript:

1 Department of Computer Engineering
Week 1 Introduction to UNIX OS Department of Computer Engineering Fall Prepared by Aykut Guven

2 Contents 2- INFORMATION ABOUT “CE.DOGUS.EDU.TR” 3- GETTING STARTED.
1- INTRODUCTION TO UNIX OPERATING SYSTEM. 2- INFORMATION ABOUT “CE.DOGUS.EDU.TR” 3- GETTING STARTED. 4- BASIC COMMANDS 5- SELF STUDY. 6- GETTING EXPERIENCE. 7- MORE SOPHISTICATED COMMANDS 8- SELF STUDY 9- ASSIGNMENTS

3 INTRODUCTION TO UNIX OPERATING SYSTEM
Last week it is told what Unix is. Briefly, Unix is Multiuser and Multitask Operating System. It is used to be implemented of large systems as secure and reliable.

4 UNIX Server of Computer Engineering. ce.dogus.edu.tr
During Labarotary sections, as a Unix Server “ce.dogus.edu.tr “ will be used. It has a Linux Red Hat 7.1 Operating System inside of it. You will attach to the System using Telnet programme.

5 UNIX Server of Computer Engineering. www1.ce.dogus.edu.tr
To Connect a Remote System using Telnet you need to have an account in that System Use your name as username and “testtest” as password. These account has been activated for you. If you have any problem with log in use this account username=“test” pass is “testtest” * Please try now and make sure you are able to log in

6 GETTING STARTED Last week we learnt how to login into Unix System in www1.ce.dogus.edu.tr. Everybody should have a Unix account. If you have not got one,Use “test” as username and “testtest” as password. Aim of this section is to show you basic UNIX commands and to teach you how to use them. For an introduction Please do these steps First. These steps will give you capability of using UNIX Shell.

7 GETTING STARTED First try to Login into the System;
Each user has a unique "home" directory. Your home directory is that part of the file system reserved for your files. After login, you are "put" into your home directory automatically. This is where you start your work. You are in control of your home directory and the files which reside there. You are also in control of the file access permissions (discussed later) to the files in your home directory. Generally, you alone should be able to create/delete/modify files in your home directory. Others may have permission to read or execute your files as you determine. In most UNIX systems, you can "move around" or navigate to other parts of the file system outside of your home directory. This depends upon how the file permissions have been set by others and/or the System Administrator, however. If you have no problem with your account, You have to be inside of your home directory in ce.dogus.edu.tr.

8 Do these steps You have connected to www1.ce.dogus.edu.tr with your username and password. Type in the following "touch file1 file2 file3" and press return. Type in "ls" to see the files in your home directory. Now, type in "ls -l" to get a longer listing with more information. Now, type in "ls -al" to get an even longer listing. This time you should see files that begin with a period "." Now, type in "man ls" and read about the "ls" command. To continue reading, press the SPACEBAR. Type the letter "q" to quit out of the man program. Type in "cd .." Now, type in "ls -al" again. Now type in "cd" (no periods this time) Type "exit" at the command line to logout.

9 What happened??? Now, Try to understand what happened when you execute these commands. What they did? For a short time later, we will go on to our Lab section.

10 Explanation about Happenings
Happening here is just executing unix commands. To start, I would like to emphasize one fact: UNIX is CASE SENSITIVE. And, most UNIX people like lower case letters for everything, so get used to it. Now Let’s have a look to the basic unix commands

11 Basic Commands ls The "ls" command will be one of your most frequently used commands. It is used to list files. You will also usually add the "switch" or options "-la" after the command to get more information about the files. In UNIX, if you name a file starting with a period (e.g. .blah) it will not appear in a regular "ls" command. It is the equivalent to a Windows "hidden" file. Now, if you are very used to Windows, you are probably wondering how you can name files after the period with something like "blah". Well, in UNIX, there is no concept of "file extensions", at least not in the Windows sort of way. For example, if you have a zip archive on your UNIX machine, you can rename it from "whatever.zip" to "whatever.bob" and you could still use the UNIX unzip utility to unzip it.

12 Basic Commands cd If you are familiar with DOS, then you already know the "cd" command. It stands for change directory. On the command line, you enter "cd" and the directory you want to go to. If the directory you want to go into is within your present directory, then you just need to put the name of the directory there. If you want to switch to a directory that is not located within your present directory, you will want to enter the full path. For example, if you are in your home directory, "/home/yourName" and want to go to the configuration file of the Apache webserver, you would type in "cd /etc/httpd/conf"; you can not simply type in "cd conf".

13 Basic Commands Man Finally, let's discuss the "man" command. "man" stands for manual. Most commands and programs in UNIX and Linux have a manual page dedicated to them. For example, if you typed in "man ls" you should be shown the manual page describing the "ls" command. If you want to exit from manual just write “Q” and press enter key.

14 GETTING EXPERIENCE Let’s go more; there is most common UNIX Commands. You are going to learn by doing. Make sure you answer the questions as you go along. Do the steps which are given below on your own.

15 GETTING EXPERIENCE Login to your practice account. If you are out of the System. Do an "ls" to see the files you have in your directory. Type in "pwd" . What do you see? Type in "uname -a" . What do you see? Now, type in "clear" . What happens? Please type in "man pwd" . What do you see? Use the spacebar to scroll through, and press "q" to quit. Now type in "mkdir" . What happens? Now type "mkdir labpractice" Type "ls". Now what do you see?

16 GETTING EXPERIENCE Type "cd labpractice".
Type "pwd". Where are you now? Type "touch lab3file". Type "ls". What do you see now? Type ls with an -al switch. What do you see? Can you tell how big the file is? Type "cp lab3file lab3file2" . Again, type "ls". What do you see now? Type "rm lab3file2". Again, type "ls". What is there?

17 GETTING EXPERIENCE Repeat the "rm" command on the other file. Do an "ls -al" to see what's in the directory. Hint: It should be empty. Type in "cd .." Take note. That is cd plus a space, plus two periods. This should bring you back up one directory and put you in your home directory. Type "ls" and then type "rm labpractice" . What happens? Type "rm -r labpractice" and then do an "ls". What happens this time? Type "mkdir public_html". Type "mkdir Desktop". Type "cd Desktop", and then type "touch file1 file2 file3 file4 file5". You are done.

18 GETTING EXPERIENCE Ls -Lists files. The equivalent of "dir" in DOS. Common switches are -al which will list all files with a long description, including their permissions, size, and datestamp. You can also type in ls -al followed by a specific filename to learn information about that specific file. This is helpful if you have many files within a directory and you only want information on one of them. You can even use wildcards. For example, ls *.html show only files with extension .html uname –aShow info about current machine and operative system pwdPrint Working Directory. Wonder which directory you're currently in? This reveals full path. clearclear the screen touchtouch filename. If filename doesn't exist it gets created (0 byte). If filename already exists, touch alters its timestamp to the current time. Please note, in UNIX we can not easily name files with spaces in them, so words should use underscores or a capital letter to separate them. For example, touch my file will not work. You must write either touch myFile or touch my_file . This applies to creating directories as well.

19 GETTING EXPERIENCE Mkdir-makes a directory. You can put files in a directory Rmdir-removes an empty directory. If it is not empty, you can use rm -rf instead. Rm-removes files. You can use it with wildcards too. For example rm -f *.html will remove all html files in the directory. You can use it to remove a directory with an -rf switch. However, this is not the ideal way to remove directories. Cp-cp originalFile newFile Creates a copy of the first file having the name of the second. If the paths are not specificied, then cp assumes you mean the current working directory. You can also copy a file to another location. For example, cp OriginalFile /home/someDirectory/newFile will copy a file from the current directory to another directory with "NewFile" as it's name. If no name is specified, and you are copying the file to another directory, then the original filename will be used.

20 Assignment Lab Assignment 1: Log on to your UNIX account. Make a directory named using your first and last name. Inside that directory, create 2 files, one for your first name and one using your second name. Issue a command to see these files' time stamps. After that, update the timestamps.

21 Assignment Lab Assignment 2:
First,Remove all directories and files which you did in the first assignment. Go to “root” and create a file which name is info. Type some information inside of the file. Then copy the file to the your home directory “home/info/” with same name. Then observe happenings.


Download ppt "Department of Computer Engineering"

Similar presentations


Ads by Google