1 / 7

CSCI 330 The UNIX System

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.

nevina
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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCI 330The UNIX System Shell History and Directory Stacks

  2. 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

  3. 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: -c clear history

  4. 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

  5. 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

  6. 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

  7. 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

More Related