SEG3460 Tutorial 1 - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

SEG3460 Tutorial 1

Description:

Shell: a program that acts as a middleman between you and the UNIX OS. A ... shell script. Running a utility program. Unix has a bundle of utility programs ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 11
Provided by: seem2
Category:
Tags: seg3460 | tutorial

less

Transcript and Presenter's Notes

Title: SEG3460 Tutorial 1


1
SEG3460 Tutorial 1
  • Unix Introduction and
  • Lab Practices

2
Introduction
  • What is Unix?
  • An operation system (OS), similar to Windows,
    MacOS X
  • Widely use in both servers and workstations
  • Why Unix?
  • Stable, Feasible, Security, etc
  • Greatest Software Ever Written!!http//www.inform
    ationweek.com/shared/printableArticle.jhtml?articl
    eID191901844
  • Freely available clone/distributions are under
    rapid development (e.g. Linux FreeBSD)

3
Lab Practices
  • Connecting to a Unix machine
  • Using Xwin
  • Using SSH
  • What is happening? Similar to remote login
  • Log-in
  • User name and password
  • Log-out
  • Type exit or logout
  • Or Ctrl-D means exit in Unix

4
Using Unix
  • Shell a program that acts as a middleman between
    you and the UNIX OS
  • A shell let users to
  • Run programs
  • Manage I/O of processes easily
  • Similar to DOS, but not only maps commands to the
    corresponding executable programs
  • Also includes a programming language shell
    script

5
Running a utility program
  • Unix has a bundle of utility programs
  • See the detail tutorial notes
  • E.g.1 date
  • E.g.2 man
  • manual page
  • For utility programs, append -s 1 when
    necessary
  • For usual usage of utilities, we dont need to
    add flag to the command, E.g.
  • man s 1 date
  • date -u

6
Unix file system in brief
  • A hierarchy of directories
  • To locate a file in the system, a pathname is
    needed
  • Command pwd
  • print your current working directory
  • Pathnames
  • Absolute pathnames
  • Starting from the root (/)
  • Relative pathnames
  • Starting from the current working directory

7
Managing Files on Unix (1)
  • Creating a file
  • touch ltnew filenamegt
  • An interesting and yet an IMPORTANT questionIf
    you create/modify a file on a Unix machine, would
    it be seen on another Unix machine?
  • Listing the content of a directory
  • ls lta directorygt
  • To view the content of a file
  • cat lta filegt
  • more lta filegt
  • head lta filegt
  • tail lta filegt
  • My favorite less lta filegt

8
Managing Files on Unix (2)
  • Moving/renaming a file
  • mv ltoldFileNamegt ltnewFileNamegt
  • mv ltaFileNamegt ltaDirectoryNamegt
  • mv ltoldDirNamegt ltnewDirNamegt
  • Making a directory
  • Mkdir ltnewDirNamegt
  • Change directory
  • cd ltaDirNamegt

9
Managing Files on Unix (3)
  • Copying a file
  • cp ltoldFileNamegt ltnewFileNamegt
  • Removing an empty directory
  • rmdir ltaDirNamegt
  • Delete a file
  • rm ltaFileNamegt
  • To remove a non-empty directory rm r
    ltaDirNamegt
  • To remove a whole directory without
    prompt/bin/rm rf ltaDirNamegt

10
Editing a file
  • emacs
  • Adv has GUI, easy for beginners
  • Dis relatively slow
  • vim (i.e. Vi Improved)
  • Adv fast for advance users
  • Dis text-version is quite difficult to learn
  • GUI version gvim, rgvim
  • To learn, type vitutor in console
  • pico
  • Adv simple, easy to learn and use
  • Dis no GUI
  • Check their man page for detail usages
Write a Comment
User Comments (0)
About PowerShow.com