DispersedNet
SiteMap
Unix Concepts
Shell Programming
Shell Scripting
Unix Questions
Unix Concepts
«Prev
Next»
Unix Concepts
File Management
List Files Command
Copy Directories Command
Removing Directories Quickly
Unix About Links
Creating File Link
Find Command Search
File Management Conclusion
Unix Customization
Creating Aliases Unix
list current Aliases
Displaying Previous Commands
Repeating Previous Commands
Modifying Previous Command
Changing System Prompt
Storing shell Settings
Customize-environment
Grep Regular Expression
Define Regex
Using Quotes with Regex
Matching Pattern Occurrences
Matching Pattern Position
Turnoff Character Meaning
Regex Conclusion
Pattern Matching - Quiz
editing with vi
vi Review
Text in vi
Creating Text
Creating Command Shortcuts
Configure Editing Environment
Storing Custom Settings
Esditing Multiple Files
Pasting Text Files
vi Editing Conclusion
Managing Disk Space
Checking Disk Usage
Compressing Uncompressing Files
Viewing Compressed Files
File Archives
Create Archive
Listing Archives
Extracting Archive Files
Managing Disk Space Conclusion
Modifying Previous Command - Exercise
Using the History Feature
Objective:
Use command history to display, repeat, and modify commands.
Exercise scoring
You will receive2 points for this exercise.
Submitting your exercise
This exercise is auto-scored. When you have finished, just click the
Submit
button to receive full credit.
Background/overview
In this exercise, you will set up the command history and enter random commands.
Then you will use the history feature to display, repeat, and modify your commands.
Instructions
Log in to your course account.
Type the script command to begin saving your UNIX session to a file named ex200-3:
% script ex200-3
Use the set history command to begin remembering up to 25 commands.
Enter random commands so that you accumulate a list of commands. Harmless commands include ls, pwd, date, who, and clear.
Use the history command to display your command history.
Try a few history substitutions. Try the main forms, !pattern, !N, and !!, at least once.
Create a new directory, but misspell the command as makedir instead of mkdir.
Use quick substitution to correct makedir to mkdir.
Use cd with the !$ word substitution to change to the directory you just created.
Type exit to end the script command.
Log out when you are done.
Exercise - Hints
If you enter the logout command, but it responds
Not login shell
, it means you forgot to end the script command.
Type exit and then logout.
Submit