BreadCrumbs: History Command
History Command
From Luke Jackson
history -- Linux/Unix/Mac OS X find command
Contents |
[edit]
Introduction
You can use history to view a list of the commands executed during the current $SHEL session. It is very helpful when are you are typing a lot of complex commands.
[edit]
Syntax
lazy....
[edit]
Usage
usage: history [-c] [-d offset] [n] or history -awrn [filename] or history -ps arg [arg...]
[edit]
Examples
[edit]
List All Entries without line numbers
history -w /dev/stdout
[edit]
Extract all history commands at end-of-session (EOS)
history -w /dev/stdout > history_EOS_`date +%a_%b_%d_%F_%T`.txt
[edit]
List All Entries
history
[edit]
Execute Entry
!<offset>
[edit]
Delete Entry
history -d <offset>
[edit]
Delete last N lines from bash history
for i in {1..50}; do history -d 1030; done