-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhistory.txt
30 lines (24 loc) · 1.07 KB
/
history.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# the man page is for the history library or somesuch? use help:
$ help history
# for when you're doing password things on the cli:
-c clear history
# random other things that you'll never ever need
-s args.. store the rest of the args in history without executing them (the command that does or calls this will
not be stored itself)
-p !foo echo the most recent history entry that starts with foo, without running it
# this ties in with bash' expansion of !stuff. !-3 will run the third-last command again,
# !123 runs command nr 123 (according to the history list)
# Disable & re-enable storing commands in history:
$ set +o history
$ set -o history
# the following is mostly copy/pasted from a random .bashrc file:
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# show with timestamps
HISTTIMEFORMAT="%F %T "