User Tools

Site Tools


scripting:bash:history

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
scripting:bash:history [2023/05/12 10:57] warnaudscripting:bash:history [2023/05/12 10:57] (current) warnaud
Line 1: Line 1:
 +====== History command ======
 +by default returns an history of latest command ran on this login\\
 +it is ~the latest "HISTSIZE" commands. it can differ with the options of HISTCONTROL (for example ignoredups which ignore duplicates)
 +===== remove the number =====
 +<code bash>history | cut -d ' ' -f 4-</code> depending on the setup you might change 4 by 5/6 ...
 +Reference: https://www.poftut.com/linux-history-command-without-line-numbers/
 +===== Avoid registering a command =====
 +When you pass some arguments like passwords, you can skip the registration of the command by adding a space before the command
  
 +<code bash> command -pass XXXXXXXXXXXXXXXXXXXXXXXXX</code>