history Flashcards
1
Q
history
A
The GNU History library is able to keep track of those lines, associate arbitrary data with each line, and utilize information from previous lines in composing new ones.
The history command with no options will print everything.
2
Q
export HISTTIMEFORMAT=’%F %T ‘
A
Changing this variable will make the history command display with a date and time.
3
Q
export HISTIGNORE=’ls -l:pwd:date: ‘
A
This filters commands in history.
4
Q
export HISTCONTROL=ignoredups
A
Changing this variable will ignore duplicate commands in the history.
5
Q
export HISTSIZE=0
A
Changing this variable disables history from recording commands.
6
Q
history -c
A
Clears the current history.
7
Q
history
- w
- d
A
- w, write the current history to the history file.
- d offset, deletes the history entry at position OFFSET. Negative offsets count back from the end of the history list.
8
Q
history
- a
- n
- r
- p
- s
A
- a, apped history lines from this session to the history file.
- n, read all history lines not already read from the history file and append them to the history list.
- r, read the history file and append the contents to the history list.
- p, perform history expansion on each ARG and display the result without storing it in the history list.
- s, append the ARGs to the history list as a single entry.