Difference between revisions of "Clear BASH Shell History"

From RHS Wiki
Jump to navigation Jump to search
(Created page with "<syntaxhighlight lang="bash"> history -w history -c </syntaxhighlight>To avoid storing a command in your history you can also place a space before the command Over ssh you ca...")
Tag: visualeditor
 
m
Tag: visualeditor
 
Line 1: Line 1:
 +
=== Delete one line from history ===
 +
<code>history -d 251</code>
 +
 +
=== Clear History ===
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
history -w
 
history -w
 
history -c
 
history -c
</syntaxhighlight>To avoid storing a command in your history you can also place a space before the command
+
</syntaxhighlight>
  
Over ssh you can exit with the command:<syntaxhighlight lang="bash">
+
=== Avoid storing one command in history ===
 +
Place a space before the command
 +
<br />
 +
 
 +
=== Over SSH: ===
 +
<syntaxhighlight lang="bash">
 
kill -9 $$
 
kill -9 $$
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 11:39, 31 October 2019

Delete one line from history[edit]

history -d 251

Clear History[edit]

history -w
history -c

Avoid storing one command in history[edit]

Place a space before the command

Over SSH:[edit]

kill -9 $$