Csci 330 the unix system
This presentation is the property of its rightful owner.
Sponsored Links
1 / 7

CSCI 330 The UNIX System PowerPoint PPT Presentation


  • 70 Views
  • Uploaded on
  • Presentation posted in: General

CSCI 330 The UNIX System. Shell History and Directory Stacks. Shell History. shell keeps a record of previously entered commands so that they can later be: Re-executed Edited Commands are saved Per session Per user. Shell History.

Download Presentation

CSCI 330 The UNIX System

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Csci 330 the unix system

CSCI 330The UNIX System

Shell History and Directory Stacks


Shell history

CSCI 330 - The UNIX System

Shell History

  • shell keeps a record of previously entered commands so that they can later be:

    • Re-executed

    • Edited

  • Commands are saved

    • Per session

    • Per user


Shell history1

CSCI 330 - The UNIX System

Shell History

  • Each previously run command gets a sequential event number

  • To view the history buffer:

    Syntax: history [-c] [count]

    • If no options are supplied, list all

      Useful options:

      -cclear history


Shell history2

CSCI 330 - The UNIX System

Shell History

  • You can re-execute history events:

    • By the event number

      % !5

    • By the number relative to current event

      % !-3

    • By the text it contains

      % !ls


Directory stacks

Directory Stacks

  • To keep track of multiple directories using stack structure

  • To maintain a directory stack, we use the following three commands:

    • pushd

    • popd

    • dirs

CSCI 330 - The UNIX System

5


Pushd

PUSHD

  • pushd (with no argument)

    to travel between two top stack entries

  • pushd directory

    to push directory on top of stack

  • pushd +n

    to rotate nth entry to the top of stack

CSCI 330 - The UNIX System

6


Popd and dirs

POPD AND DIRS

  • popd (with no argument)

    to remove the top directory and changes to the next stack entry

  • popd +n

    to remove the nth directory from stack

  • dirs:

    to display all directory entries.

    The top entry is listed at the leftmost position

CSCI 330 - The UNIX System

7


  • Login