bash history
ascendence is rattling useful. It gives yous an consummate stance of what commands yous ran. By default bash history
command volition hand yous all your previous commands amongst Line numbers. It’s the default behavior. However when you’re trying to copy-paste those commands again, yous convey to manually take away those Line numbers. This becomes rather annoying when yous are trying to re-create glue a lot of commands at the same time. This is rattling unproblematic guide on how to stance bash history without describe numbers.
bash history amongst describe numbers
When yous type inwards history
inwards your bash terminal, next what yous see.
root@kali: # history
-------snip------------
2002 clear
2003 ls
2004 cd
2005 top
2006 nethogs wlan0
2007 htop
2008 sar -r
2009 complimentary -m
2010 pstree
2011 pgrep gdm3
2012 w
2013 who
2014 concluding | head
-------snip------------
This is rattling normal behavior.
My target is to take away these describe numbers as well as only stance the actual commands as well as thence that I tin re-create glue them easily.
View bash history without describe numbers
Extremely unproblematic command. We utilize cutting to produce this job:
root@kali: # history | cutting -c 8-
cut
= cutting removes sections from each describe of files
-c
= -c volition guide entirely sure enough characters
8-
= 8- or N- volition demo output from N’th byte, graphic symbol or field, to goal of line. In this case, bash history
ascendence shows actual ascendence from eighth character. Adjust your ascendence to check your output.
Output for bash history ascendence without describe numbers
-------snip------------
clear
history
history | tail
clear
history
clear
last | head
w
whoami
uname -a
lsb_release -a
clear
history | tail
history | cutting -c 8-
-------snip------------
Hope this helps somebody out there.
Credit: http://stackoverflow.com/questions/7110119/bash-history-without-line-numbers