I want to write a python script which reads the ‘.bash_history’ file and prints the statistics. Also, I would like to print the command which was used the most. I was able to read the bash history through the terminal but I’m not able to do it through python programming. Can someone please help me with how to start with it?
Share
Something beginning with…
Now we have the file open… what operations do you want to do now?
Print the contents of the file.
Turn the string into an array of lines…
Now you can do array sorting, filtering etc. to your hearts content.