An Introduction to the Unix Command Line - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

An Introduction to the Unix Command Line

Description:

Users start with their home directory as their pwd when they login. Changing Directories ... pwd reports present working directory ... – PowerPoint PPT presentation

Number of Views:90
Avg rating:3.0/5.0
Slides: 24
Provided by: Instructio77
Category:

less

Transcript and Presenter's Notes

Title: An Introduction to the Unix Command Line


1
An Introduction to the Unix Command Line
2
What is Unix?
  • A fully featured modern operating system
  • It is available in a variety of flavors.
  • Its comprised of simple tools that perform a
    single function well.
  • These tools can be used together to perform
    complex tasks.

3
Unix is Made Up of
  • Processes
  • Running Programs
  • User owned
  • System owned
  • Files
  • Regular Files
  • Data
  • Executables lt-- usually start a process
  • Directory Files
  • Contain other files and directories
  • Special Files

4
Our View of the World as Users
Your Shell A shell is a process that acts as an
interface to the OS. It allows the user to run
programs individually and together to accomplish
a task.
5
Use the command line
  • While graphical user interfaces are available
    and often used on Unix systems you must have a
    working knowledge of the standard command line
    utilities, pipes, and I/O redirection to benefit
    from the considerable strengths of Unix.

6
Simple Unix Directory Structure
7
Your First Command
Man(manual) -- Documentation is your friend
  • Syntax man topic
  • man provides online documentation on nearly every
    standard command and configuration file.
  • Optional Syntax man -k keyword
  • man man for more details

8
Special Directories
  • Home Directory
  • /home/grad/jpeckhar
  • jpeckhar
  • A user generally has permission to freely
    manipulate files within this directory and its
    children.
  • Users start with their home directory as their
    pwd when they login.

9
Changing Directories
  • The cd(Change Directory) command is used to
    change directories
  • cd path
  • Paths can be relative or absolute
  • pwd reports present working directory
  • cd when entered by itself sets the pwd to the
    users home directory.

10
Your Prompt Helps you Navigate
  • The default prompt on your CS account tells
    you what directory is your pwd(where you are at
    the moment).
  • Some Examples
  • csy12/bingt
  • csy12/home
  • csy12/usr/man

11
Other File System Utilities
12
Basic Syntax
13
Other Simple Commands
14
Other Comands
  • Every Unix distribution comes with hundreds
    of other standard commands that can be used for
    everything from viewing and searching files to
    developing software.
  • Look through /bin, /usr/bin, and
    /usr/local/bin on most systems system and look at
    the man pages for the programs in those
    directories for more information.

15
Using Other Commands Syntax command file
16
Pipes and Redirection
  • The Unix philosophy involves a set of
    generic tools which each do one thing well. Using
    these tools together allows you to appreciate the
    power of the Unix command.
  • In Unix everything (including hardware
    devices) is treated as a File that can be read
    from and written to.

17
Pipes
  • Pipes connect stdout of one command to stdin of
    another comand. i.e.
  • ls less
  • cat student_list grep senior sort

18
I/O Redirection
  • I/O redirection allows the user to change where
    input to a command or output from a command goes
    to/comes from.
  • cat student_list gt outfile
  • program lt infile
  • program lt infile gt outfile

19
Standard File Handles
  • Every Unix process automatically comes with
    three file handles or descriptors.
  • These are
  • Standard Input (stdin)
  • Keyboard
  • Standard Output (stdout)
  • Display
  • Standard Error (stderr)
  • Display (unbuff)

20
Three Default Open Files
Program
stdout
Buffer
stdin
stderr
21
Standard File Handles
  • All standard shells provide a facility to
    re-map these three file handles to other devices
    and files in addition to other commands.
  • This allows one to use several simple Unix
    commands to perform a complex task.

22
Pipes
23
Shell/Environment Variables
Write a Comment
User Comments (0)
About PowerShow.com