![]() ![]() In the previous section of this guide, I talked about how the “history” for the Linux terminal is just a neatly hidden text file that contains all user-entered commands. history | grep 'search term' Save terminal history to a backup It also works as the current logged in user with the “history” command. cat /home/user/.bash_history | grep 'git clone' So, for example, to find instances of “git clone” in username with the command below. historyīest of all, since “history” is just a file, it can be searched like a regular text file using the grep function. ![]() ![]() Users can also view the history of the current user they’re logged into in the Linux terminal shell, by simply executing the “history” command. So, for example, if I want to take a look at the terminal/command-line history of username “user” on my Linux system, I’d do: Special permissions do not protect these history files, and any user on the system can take a look at the history of another with a simple command. Since the terminal history file for Linux is stored in a user directory, every single user on the system has a file. This file is named “.bash_history.” Anyone can edit it, and it is stored in the home directory. ![]() The Linux terminal stores its history in a file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |