What is Unix - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

What is Unix

Description:

The internet was designed on it, thus networking ... In fact, commands are actually executables. However, you may need to specify the path to your executables. ... – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 15
Provided by: kfup
Category:

less

Transcript and Presenter's Notes

Title: What is Unix


1
What is Unix?
  • A multi-user networked operating system
  • Operating System
  • Handles files, running other programs,
    input/output
  • Looks like DOSbut more powerful
  • The internet was designed on it, thus networking
    is an intrinsic part of the system
  • Multi-user
  • Every user has different settings and permissions
  • Multiple users can be logged in simultaneously

2
Unix vs. Linux
  • Age
  • Unix born in 1970 at ATT/Bell Labs
  • Linux born in 1992 in Helsinki, Finland
  • Sun, IBM, HP are the 3 largest vendors of Unix
  • These Unix flavors all run on custom hardware
  • Linux is FREE!
  • Linux was written for Intel/x86, but runs on many
    platforms

3
IWS (Instructional Work Servers)
  • Accessing the servers
  • Terminal Programs
  • ssh (via the TeraTerm or Putty programs)
  • Start -gt Program Files -gt Desktop Tools -gt
    TeraTerm
  • File Transfer Programs
  • On CCSE lab Windows machines
  • Start -gt Run
  • telnet ltserver namegt
  • Secure FTP (
  • The X Window System

4
Logging In
  • Although your Windows and Unix usernames are the
    same, they have separate accounts (different
    passwords)
  • Your z drive is not your Unix account
  • Connecting
  • Well connect to the Unix machines via telnet
  • After connection, you are presented with a login
    prompt
  • After logging in, youre placed in your home
    directory (where your personal files are located)

5
The Command Prompt
  • Commands are the way to do things in Unix
  • A command consists of a command name and options
    called flags
  • Commands are typed at the command prompt
  • In Unix, everything (including commands) is
    case-sensitive

prompt ltcommandgt ltflagsgt ltargsgt
CCSE.LINUX ls l -a unix-tutorial
Command
(Optional) arguments
Command Prompt
(Optional) flags
Note Many Unix commands will print a message
only if something went wrong. Be careful with rm
and mv.
6
Getting help with man
  • man (short for manual) documents commands
  • man ltcmdgt retrieves detailed information about
    ltcmdgt
  • man k ltkeywordgt searches the man page summaries
    (faster, and will probably give better results)
  • man K ltkeywordgt searches the full text of the
    man pages

fiji man k password passwd (5) - password
file xlock (1) - Locks the local X display
until a password is entered fiji passwd
7
Directories
  • In Unix, files are grouped together in other
    files called directories, which are analogous to
    folders in Windows
  • Directory paths are separated by a forward slash
    /
  • Example /homes/iws/robh/classes/cse326
  • The hierarchical structure of directories (the
    directory tree) begins at a special directory
    called the root, or /
  • Absolute paths start at /
  • Example /homes/iws/robh/classes/cse326
  • Relative paths start in the current directory
  • Example classes/cse326 (if youre currently in
    /homes/iws/robh)
  • Your home directory is where your personal
    files are located, and where you start when you
    log in.
  • Example /homes/iws/robh

8
Directories (contd)
  • Handy directories to know
  • Your home directory
  • .. The parent directory
  • . The current directory
  • ls
  • LiSts the contents of a specified files or
    directories (or the current directory if no files
    are specified)
  • Syntax ls ltargsgt
  • Example ls backups/
  • pwd
  • Print Working Directory

9
Directories (contd further)
  • cd
  • Change Directory (or your home directory if
    unspecified)
  • Syntax cd ltdirectorygt
  • Examples
  • cd backups/unix-tutorial
  • cd ../class-notes
  • mkdir
  • MaKe DIRectory
  • Syntax mkdir ltdirectoriesgt
  • Example mkdir backups class-notes
  • rmdir
  • ReMove DIRectory, which must be empty first
  • Syntax rmdir ltdirectoriesgt
  • Example rmdir backups class-notes

10
Files
  • Unlike Windows, in Unix file types (e.g.
    executable files, data files, text files)
    are not determined by file extension (e.g.
    foo.exe, foo.dat, foo.txt)
  • Thus, the file-manipulation commands are few and
    simple
  • Many use only 2 letters
  • rm
  • ReMoves a file, without a possibility of
    undelete!
  • Syntax rm ltfile(s)gt
  • Example rm tutorial.txt backups/old.txt

11
Files (contd)
  • cp
  • CoPies a file, preserving the original
  • Syntax cp ltsourcesgt ltdestinationgt
  • Example cp tutorial.txt tutorial.txt.bak
  • mv
  • MoVes or renames a file, destroying the original
  • Syntax mv ltsourcesgt ltdestinationgt
  • Examples
  • mv tutorial.txt tutorial.txt.bak
  • mv tutorial.txt tutorial-slides.ppt backups/

Note Both of these commands will over-write
existing files without warning you!
12
Shell Shortcuts
  • Tab completion
  • Type part of a file/directory name, hit lttabgt,
    and the shell will finish as much of the name as
    it can
  • Works if youre running tcsh or bash
  • Command history
  • Dont re-type previous commands use the
    up-arrow to access them
  • Wildcards
  • Special character(s) which can be expanded to
    match other file/directory names
  • Zero or more characters
  • ? Zero or one character
  • Examples
  • ls .txt
  • rm may-?-notes.txt

13
Editing Text
  • Which text editor is the best is a holy war.
    Pick one and get comfortable with it.
  • Three text editors you should be aware of
  • pico Easy! Comes with pine (Dantes email
    program)
  • emacs/xemacs A heavily-featured editor commonly
    used in programming
  • vim/vi A lighter editor, also used in
    programming
  • Your opinion is wrong.

14
Programs and Compilation
  • To compile a program
  • g ltoptionsgt ltsource filesgt
  • Recommended g -Wall ansi o ltexecutable_namegt
    .cpp
  • -Wall show all warnings
  • -ansi Strict ANSI compliance
  • Whats an executable?
  • In Windows, double-clicking on an icon runs a
    program
  • E.g. double-click on C\Windows\notepad.exe
  • In Unix, you can run your executable from the
    command line!
  • Type the executable name at the prompt, just like
    a command
  • In fact, commands are actually executables
  • However, you may need to specify the path to your
    executables
  • ./ltprogramgt runs ltprogramgt in the current
    directory
  • Example
  • ceylonehsu g -Wall ansi o hello hello.cpp
  • ceylonehsu ./hello
Write a Comment
User Comments (0)
About PowerShow.com