I am new here and in the Linux world. So i am wondering if it is possible to search for a word in the content that i already have in my terminal. Thanks in advance

0

2 Answers

Not exactly --

You have to copy the whole terminal content and save them into a file, before you can use grep to search words on the content.

Copying the content from terminal various from terminal to terminal, but I bet yours has a menu which allows you doing so.

If you can plan ahead, check out script - make typescript of terminal session.

As already mentioned you can use the script command to record all your terminal output to a file called typescript and then search that file later.

Out-of-the-box however, you can use grep on all the commands you've entered. For example:

$ grep eyesome ~/.bash_history cd eyesome gedit eyesome-src.sh sudo eyesome/movie.sh pgrep eyesome sudo eyesome/movie.sh a cat /usr/local/bin/.eyesome-sunrise cat /usr/local/bin/.eyesome-sunset sudo eyesome/movie.sh sudo ~/eyesome/movie.sh ~/eyesome/movie.sh ~/eyesome/movie.sh cd ../eyesome ll ../.eyesome* ll ../.eyesome-cfg rm /usr/local/bin/.eyesome-cfg.bad* sudo rm /usr/local/bin/.eyesome-cfg.bad* sudo rm /usr/local/bin/.eyesome-cfg.fast sgedit eyesome-cfg.sh 

Simply use your search string (in this case eyesome) and specify the command history file name which is ~/.bash_history.