Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI The UNIX System Shell History and Directory Stacks

Similar presentations


Presentation on theme: "CSCI The UNIX System Shell History and Directory Stacks"— Presentation transcript:

1 CSCI 330 - The UNIX System Shell History and Directory Stacks
NIU - Department of Computer Science

2 The C Shell 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 CSCI The UNIX System Copyright Department of Computer Science, Northern Illinois University, 2005

3 The C Shell 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 CSCI The UNIX System Copyright Department of Computer Science, Northern Illinois University, 2005

4 Shell History You can re-execute history events: By the event number
The C Shell 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 CSCI The UNIX System Copyright Department of Computer Science, Northern Illinois University, 2005

5 The C Shell 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 The UNIX System 5 Copyright Department of Computer Science, Northern Illinois University, 2005 5

6 PUSHD pushd (with no argument) to travel between two top stack entries
The C Shell 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 The UNIX System 6 Copyright Department of Computer Science, Northern Illinois University, 2005 6

7 POPD AND DIRS popd (with no argument)
The C Shell 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 The UNIX System 7 Copyright Department of Computer Science, Northern Illinois University, 2005 7


Download ppt "CSCI The UNIX System Shell History and Directory Stacks"

Similar presentations


Ads by Google