How to delete history of last 10 commands in shell?

前端 未结 19 1827
孤城傲影
孤城傲影 2021-01-29 18:47

Commands follows

  511  clear
  512  history
  513  history -d 505
  514  history
  515  history -d 507 510 513
  516  history
  517  history -d 509
  518  hist         


        
19条回答
  •  粉色の甜心
    2021-01-29 19:35

    Not directly the requested answer, but maybe the root-cause of the question:

    You can also prevent commands from even getting into the history, by prefixing them with a space character:

    # This command will be in the history
    echo Hello world
    
    # This will not
     echo Hello world
    

提交回复
热议问题