History Command - Revision history http://wiki.ljackson.us/index.php?title=History_Command&action=history Revision history for this page on the wiki en MediaWiki 1.7.1 Fri, 29 Mar 2024 00:02:55 GMT Ljackson: /* Examples */ http://wiki.ljackson.us/index.php?title=History_Command&diff=3535&oldid=prev <p><span class="autocomment">Examples</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 05:13, 18 November 2020</td> </tr> <tr><td colspan="2" align="left"><strong>Line 17:</strong></td> <td colspan="2" align="left"><strong>Line 17:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries without line numbers ===</td><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries without line numbers ===</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> history -w /dev/stdout</td><td> </td><td style="background: #eee; font-size: smaller;"> history -w /dev/stdout</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">=== Extract all history commands at end-of-session (EOS) ===</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> history -w /dev/stdout &gt; history_EOS_`date +%a_%b_%d_%F_%T`.txt</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries ===</td><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries ===</td></tr> <tr><td colspan="2" align="left"><strong>Line 29:</strong></td> <td colspan="2" align="left"><strong>Line 32:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> history -d &lt;offset&gt;</td><td> </td><td style="background: #eee; font-size: smaller;"> history -d &lt;offset&gt;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">=== Delete last N lines from bash history ===</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> for i in {1..50}; do history -d 1030; done</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Mac OS X]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Mac OS X]]</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Linux]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Linux]]</td></tr> </table> Wed, 18 Nov 2020 05:13:07 GMT Ljackson http://wiki.ljackson.us/Talk:History_Command Ljackson: /* List All Entries without line numbers */ http://wiki.ljackson.us/index.php?title=History_Command&diff=3534&oldid=prev <p><span class="autocomment">List All Entries without line numbers</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 05:09, 18 November 2020</td> </tr> <tr><td colspan="2" align="left"><strong>Line 16:</strong></td> <td colspan="2" align="left"><strong>Line 16:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries without line numbers ===</td><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries without line numbers ===</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> history -w /dev/stdout <span style="color: red; font-weight: bold;">| grep 'date'</span></td><td>+</td><td style="background: #cfc; font-size: smaller;"> history -w /dev/stdout</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries ===</td><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries ===</td></tr> </table> Wed, 18 Nov 2020 05:09:48 GMT Ljackson http://wiki.ljackson.us/Talk:History_Command Ljackson: /* Examples */ http://wiki.ljackson.us/index.php?title=History_Command&diff=3533&oldid=prev <p><span class="autocomment">Examples</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 05:09, 18 November 2020</td> </tr> <tr><td colspan="2" align="left"><strong>Line 15:</strong></td> <td colspan="2" align="left"><strong>Line 15:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">== Examples ==</td><td> </td><td style="background: #eee; font-size: smaller;">== Examples ==</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">== List All Entries without line numbers</td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;">=</span>== List All Entries without line numbers <span style="color: red; font-weight: bold;">===</span></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> history -w /dev/stdout | grep 'date'</td><td> </td><td style="background: #eee; font-size: smaller;"> history -w /dev/stdout | grep 'date'</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"></td><td colspan="2">&nbsp;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries ===</td><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries ===</td></tr> </table> Wed, 18 Nov 2020 05:09:31 GMT Ljackson http://wiki.ljackson.us/Talk:History_Command Ljackson: /* Examples */ http://wiki.ljackson.us/index.php?title=History_Command&diff=3532&oldid=prev <p><span class="autocomment">Examples</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 05:09, 18 November 2020</td> </tr> <tr><td colspan="2" align="left"><strong>Line 14:</strong></td> <td colspan="2" align="left"><strong>Line 14:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">== Examples ==</td><td> </td><td style="background: #eee; font-size: smaller;">== Examples ==</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">== List All Entries without line numbers</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> history -w /dev/stdout | grep 'date'</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries ===</td><td> </td><td style="background: #eee; font-size: smaller;">=== List All Entries ===</td></tr> </table> Wed, 18 Nov 2020 05:09:18 GMT Ljackson http://wiki.ljackson.us/Talk:History_Command Ljackson: /* Syntax */ http://wiki.ljackson.us/index.php?title=History_Command&diff=1919&oldid=prev <p><span class="autocomment">Syntax</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 18:05, 4 January 2007</td> </tr> <tr><td colspan="2" align="left"><strong>Line 7:</strong></td> <td colspan="2" align="left"><strong>Line 7:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">== Syntax ==</td><td> </td><td style="background: #eee; font-size: smaller;">== Syntax ==</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><span style="color: red; font-weight: bold;">&lt;pre&gt;</span></td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;">lazy....</span></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">&#160;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><span style="color: red; font-weight: bold;"> history</span></td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">&#160;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><span style="color: red; font-weight: bold;">&lt;/pre&gt;</span></td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">&#160;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">== Usage ==</td><td> </td><td style="background: #eee; font-size: smaller;">== Usage ==</td></tr> </table> Thu, 04 Jan 2007 18:05:31 GMT Ljackson http://wiki.ljackson.us/Talk:History_Command Ljackson at 18:05, 4 January 2007 http://wiki.ljackson.us/index.php?title=History_Command&diff=1918&oldid=prev <p></p> <p><b>New page</b></p><div>'''history''' -- Linux/Unix/Mac OS X find command<br /> <br /> == Introduction ==<br /> <br /> You can use '''history''' to view a list of the commands executed during the current $SHEL session. It is very helpful when are you are typing a lot of complex commands.<br /> <br /> == Syntax ==<br /> <br /> &lt;pre&gt;<br /> <br /> history<br /> <br /> &lt;/pre&gt;<br /> <br /> <br /> == Usage ==<br /> <br /> usage: history [-c] [-d offset] [n] or history -awrn [filename] or history -ps arg [arg...]<br /> <br /> == Examples ==<br /> <br /> === List All Entries ===<br /> <br /> history<br /> <br /> === Execute Entry ===<br /> <br /> !&lt;offset&gt;<br /> <br /> === Delete Entry ===<br /> <br /> history -d &lt;offset&gt;<br /> <br /> <br /> [[Category:Mac OS X]]<br /> [[Category:Linux]]</div> Thu, 04 Jan 2007 18:05:11 GMT Ljackson http://wiki.ljackson.us/Talk:History_Command