Check all the history commands
history
Use Up arrow key to scroll
Press Ctrl + r to search command
Press Esc to quit search mode
Execute specific command
![Command Index]
Exp: !22
Save all the history commands to specific file
history -w
The file .bash_history will be stored at home directory
cd ~
ls -a
cat .bash_history
Delete a specific command in history
history -d [Command Index]
Exp: history -d 28
Clear all the history commands
history -c
student@localhost:~$ history
1 history
2 history -w
3 history -d nn
4 history
5 history -w
6 history
7 history -w
8 history
9 history -w
10 history
11 history -d nn
12 hostory
13 history
14 history -d 7
15 history
16 ls
17 rm -rf error.txt
18 ls
19 rm -rf result.txt
20*
21 rm -rf success.txt
22 ls
23 ls ~a ~
24 ls ~a
25 ls --help
26 clear
27 ls -a
28 cat .bash_hostory
29 cat .bash_history
30 history
31 ls
32 history -w
33 ~
34 ls -a
35 cd ~
36 clear
37 history
student@localhost:~$ !22
ls
Desktop Documents Downloads Music Pictures Public Templates Videos
student@localhost:~$ history -w
student@localhost:~$ cd ~
student@localhost:~$ ls -a
. .bash_history .bash_profile .cache Desktop Downloads .mozilla Pictures .swp Videos
.. .bash_logout .bashrc .config Documents .local Music Public Templates .viminfo
student@localhost:~$ cat .bash_history
history
history -w
history -d nn
history
history -w
history
history -w
history
history -w
history
history -d nn
hostory
history
history -d 7
history
ls
rm -rf error.txt
ls
rm -rf result.txt
rm -rf success.txt
ls
ls ~a ~
ls ~a
ls --help
clear
ls -a
cat .bash_hostory
cat .bash_history
history
ls
history -w
~
ls -a
cd ~
clear
history
ls
history -w
student@localhost:~$ history -d 28
student@localhost:~$ history
1 history
2 history -w
3 history -d nn
4 history
5 history -w
6 history
7 history -w
8 history
9 history -w
10 history
11 history -d nn
12 hostory
13 history
14 history -d 7
15 history
16 ls
17 rm -rf error.txt
18 ls
19 rm -rf result.txt
20*
21 rm -rf success.txt
22 ls
23 ls ~a ~
24 ls ~a
25 ls --help
26 clear
27 ls -a
28 cat .bash_history
29 history
30 ls
31 history -w
32 ~
33 ls -a
34 cd ~
35 clear
36 history
37 ls
38 history -w
39 cd ~
40 ls -a
41 cat .bash_history
42 history -d 28
43 hostory
44 history
student@localhost:~$ history -c
student@localhost:~$ history
1 history
student@localhost:~$