What is Unix - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

What is Unix

Description:

The internet was designed on it, thus networking is an ... ReMoves a file, without a possibility of 'undelete!' Syntax: rm file(s) e.g. rm tutorial.txt ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 16
Provided by: facultyUs2
Category:
Tags: undelete | unix

less

Transcript and Presenter's Notes

Title: What is Unix


1
What is Unix?
  • A multi-user networked operating system
  • Handles processes, memory, files, input/output
  • Multi-user
  • Every user has different settings and permissions
  • Multiple users can be logged in simultaneously
  • The internet was designed on it, thus networking
    is an intrinsic part of the system

2
Unix vs. Linux
  • Age
  • Unix born in 1970 at ATT/Bell Labs
  • Linux born in 1992 in Helsinki, Finland (Linus
    Torvalds)
  • Sun, IBM, HP are the 3 largest vendors of Unix
  • These Unix flavors all run on custom hardware
  • Linux is FREE!
  • written for Intel/x86, but runs on many platforms
  • one of the most prominent examples of free
    software and of open-source development
  • all source code is available to the public and
    anyone can freely use, modify, improve, and
    redistribute it.

3
What is Linux ?
  • In the narrowest sense, the term Linux refers to
    the Linux kernel
  • It is commonly used to describe entire Unix-like
    operating systems (aka. GNU/Linux) that are based
    on the Linux kernel combined with libraries and
    tools from the GNU project and other sources
  • Most broadly, a Linux distribution bundles large
    quantities of application software with the core
    system, and provides more user-friendly
    installation and upgrades.

4
Growth of Linux
  • Initially, Linux was primarily developed and used
    by individual enthusiasts.
  • Linux has gained the support of major
    corporations such as IBM, Sun Microsystems,
    Hewlett-Packard, and Novell for use in servers
    and is gaining popularity in the desktop market.
  • Analysts attribute this success to its vendor
    independence, low cost, security, and
    reliability.
  • Linux was originally developed for Intel 386
    microprocessors and now supports all popular
    computer architectures.
  • It is deployed in applications ranging from
    embedded systems to personal computers to
    supercomputers.

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

prompt ltcommandgt ltflagsgt ltargsgt
frank ls al unix-tutorial
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

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

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
  • pwd
  • print Working Directory

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

10
Files
  • Unlike Windows, in Linux 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. (e.g. hello.c, lecture1_note)
  • rm
  • ReMoves a file, without a possibility of
    undelete!
  • Syntax rm ltfile(s)gt
  • e.g. rm tutorial.txt

11
Files (contd)
  • cp
  • CoPies a file, preserving the original
  • Syntax cp ltsourcesgt ltdestinationgt
  • e.g. cp tutorial.txt tutorial.txt.bak
  • mv
  • MoVes or renames a file, destroying the original
  • Syntax mv ltsourcesgt ltdestinationgt
  • e.g. mv tutorial.txt tutorial.txt.bak

Warning 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 bash or tcsh
  • 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
  • e.g. ls .txt

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

14
Programs and Compilation
  • To compile a program
  • cc ltoptionsgt ltsource filesgt OR gcc ltoptionsgt
    ltsource filesgt
  • -Wall show all warnings
  • Whats an executable?
  • In Windows, double-clicking on an icon runs a
    program
  • In Linux, 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
  • e.g.
  • frank cc -Wall single_main.c o single_main
  • frank ./ single_main

15
Whats Next ?
  • Read Lab manual
  • Preface to the student
  • Part 1 section 1 and 2
  • Introduction to Linux A Hands on Guide
  • http//www.tldp.org/LDP/intro-linux/html/index.ht
    ml
  • chapter 1 and 2
  • practice, practice, practice
  • Find a textbook or tutorial to learn C, and
    compiling C Programs on Linux
  • http//users.actcom.co.il/choo/lupg/tutorials/c-o
    n-unix/c-on-unix.html
  • Emacs Tutorial
  • http//www.aims.ac.za/resources/tutorials/emacs/s
    tarted.php
Write a Comment
User Comments (0)
About PowerShow.com