User Tools

Site Tools


docs:tips_n_tricks:bash.html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
docs:tips_n_tricks:bash.html [09.03.2024 01:48 CET] – created peterdocs:tips_n_tricks:bash.html [07.04.2024 15:23 CEST] (current) – [Undo edits in history] peter
Line 4: Line 4:
   bind 'set revert-all-at-newline on'   bind 'set revert-all-at-newline on'
  
-__References__: [[https://superuser.com/a/593739|Superuser - How can I reset an edited history line in Bash?]]+__References__: 
  
 +  * [[https://superuser.com/a/593739|Superuser - How can I reset an edited history line in Bash?]]
 +  * [[https://superuser.com/a/302252|Superuser - How to prevent Bash from altering history?]]
 +  * [[https://unix.stackexchange.com/a/131712|Unix Stackexcange - Is there any way to undo a bash history modification?]]
  
-"It's even more complicated. Bash seems to restore the originally executed command, if you go back to its modified version using up, erase that one completely (C-u), press enter, and then again go back in the history. Don't ask me why. – Uwe May 8, 2013 at 12:02"+===== History operations ===== 
 +==== Save history without exiting bash ==== 
 +  history -
 +==== Show history with full timestamps ==== 
 +  HISTTIMEFORMAT='%Y-%m-%d %H:%M:%S ' history 
 +==== Undo edits in history ====
  
-__References__: A comment to [[https://superuser.com/a/592925|Superuser How can I reset an edited history line in Bash?]]+|M-r (or ESC,r) |Restore last version| 
 +|//erase line and press ENTER//|:::| 
 +|C-x,C-u        |Undo last key| 
 +|C-_            |:::| 
 +|C-/            |:::|
  
 +__References__:
 +  * [[https://stackoverflow.com/a/38961073|Prevent accidental history editing in bash]]
 +  * [[https://superuser.com/a/592958|How can I reset an edited history line in Bash?]]
 +  * A comment to [[https://superuser.com/a/592925|Superuser - How can I reset an edited history line in Bash?]]
 +
 +===== Bash Prompt =====
 +
 +*  http://ceving.blogspot.com/2015/10/limit-length-of-path-in-bash-prompt.html
docs/tips_n_tricks/bash.html.1709945323.txt.gz · Last modified: 09.03.2024 01:48 CET by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki