All Questions
4 questions
1
vote
2
answers
239
views
bash, pass an argument to the 'history' command
I do the following to make history more sensible (i.e. seeing when a command is run can be fairly critical when troubleshooting)
shopt -s histappend; # Append commands to the bash history (~/....
1
vote
1
answer
226
views
cycle through reverse search in a custom command history file in bash
I added a line to ~/.bashrc file which appends all issued commands to ~/.bash_eternal_history file in a date directory history-number command format, such as:
2019-01-08.23:59:32 /home/sport/...
2
votes
2
answers
921
views
How can I filter certain commands from multi-line Bash history on logout?
I've configured Bash to save multiline history entries with embedded newlines.
shopt -s cmdhist lithist
export HISTTIMEFORMAT='%F %T '
When I exit the shell, my history is appended to ~/.bash_history ...
2
votes
6
answers
464
views
Bash - Split the previous commands parameters
How would one parse the previous command in bash?
Example:
root$ ssh [email protected]
root$ echo !$ &>/tmp/foo.txt
root$ cat /tmp/foo.txt
[email protected]
Goal:
Send just the ipaddress 1.2.3.4 to foo....