How to view linux command history | linux history command in terminal

How to view Linux Terminal History

Command : history


Using Linux history Command You Can View Linux Command History in Linux terminal.
linux history command to view linux command history
Show Terminal Command History Using History Command in Linux


Write Linux History To a Text  File

You Can Also Write Linux Command History to Text file by typing history>filename Where file Name is name of you're out put file 
ex : history>history.txt
export linux command history to a text file
Export Terminal History to Text File

In Above example we export Command History to file called history.txt.

if you Don't have a file you specified in you're current directory Linux Will Create a file new file.in this Case history.txt file will be created in user Desktop.

export linux command history to text file
history.txt file Showing Linux Command History


Clear Linux History

Type history -c in terminal to clear terminal history
Clear Linux Terminal History history -c
Clear history using history -c Command


Summary

history = View History
history>filename.txt = write history to a test file
history -c = Clear History

No comments:

Post a Comment