You are not logged in.
Pages: 1
i have used the terminal command 'history' a few times and wonder that I can not edit in the list
What I would like to have is a list where every single command that has been used appears only once, is that possible ?
Last edited by devur (2017-10-06 07:01:28)
Laptop lenovo
Desktop XFCE
Os Devuan GNU/Linux
Offline
sort -u ~/.bash_history
Offline
yes, that's get me part of the way
How do I get a numbered list with just one example of each used command
so I can use !111 to enable a command
Laptop lenovo
Desktop XFCE
Os Devuan GNU/Linux
Offline
sort -u ~/.bash_history > temporary-file
cat temporary-file > ~/.bash_history
nl temporary-file > index_file
Use the index file for reference. You don't want to number the lines in .bash_history, but you do want a numbered list.
This will work until you reach the limit of bash_history, and the commands start scrolling off the top. See 'man bash' for the HISTSIZE setting if you want to change the number of lines that get saved. I don't remember what the default is - maybe 1000 or 2000.
Offline
Yes, that's the solution
Laptop lenovo
Desktop XFCE
Os Devuan GNU/Linux
Offline
Pages: 1