What is your HISTSIZE variable set to? What is your HISTFILE variable set to? Check your .kshrc file to see if set –o vi is there. If it has not been set, set it in the .kshrc file and re-execute the file by typing the following:
. .kshrc
Type the following commands at the command line:
ls
date
who
cal 2 1993
date +%T
Type history or fc –l. What do these commands do? Print your history list in reverse. Print your history list without numbers. Print the current command and the five preceding it. Print everything from the tenth command to the present. Print everything between the most recent ls command to the most recent cal command.
Using the r command, re-execute the last command. Re-execute the last command that started with the letter d. Change the cal command year output to 1897. Change the date command +%T argument to find the current hour.
If your history is set, press the Esc key at the command line and use the K key to move up through the history list. Change the ls command to ls –alF and re-execute it.
Check to see if the FCEDIT variable has been set by typing the env command. If it has not been set, type the following at the command line:
export FCEDIT=vi
Now type the following at the command line:
fc –1 –4
What happened?
How do you comment a line from your history list, so that it will be placed on the list without being executed?
At the command line, type the following:
touch a1 a2 a3 apples bears balloons a4 a45
Now using the history Esc sequences, do the following:
Print the first file beginning with a.
Print a list of all files beginning with a.
Print the first file beginning with b.
Print a command and comment it.
At the command line, type the following:
print a b c d e
Using the history Esc underscore command, change the command to the following:
print e
Using the history Esc underscore command, change the first command to output: