How to find the last 10 command that you used on the command line in Linux

H

How Can We Help?

How to find the last 10 command that you used on the command line in Linux

  • Type in the following command in the CLI
    history | tail -n 10
  • This command will list the last 10 command line commands that you used.
  • Example
      506  history n
    
      507  history | tail 
    
      508  history | tail -10
    
      509  history | tail -n 3
    
      510  pgrep skype
    
      511  pgrep phone
    
      512  grep -rni 'test' *.php
    
      513  cd /var/www/test/
    
      514  grep -rni 'test' *.php
    
      515  history | tail -n 10

About the author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

About Author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

Follow Me