Unix & Linux

Find a text inside multiple files in linux

To find files that contain a text string in linux is very easy. Open terminal locate to the folder. Use below command. grep -lir “search text” * The -l switch outputs only the names of files in which the text occurs, the -i switch ignores the case, and the -r descends into sub directories.

How to kill any process in Linux?

To kill any process yo need to first find out the process ID (PID) For example if you want to kill firfox #ps aux | grep firefox This will generate: username   5365  0.0  0.0  3572  628 pts/0    S    11:00   0:00 grep firefox Now kill process using PID #kill 5365 #kill -9 5365 where -9 is […]

How to select text vertically in vi/vim editor

To select the text vertically first press escape if you are in insert mode. Then type: ^v (Control v) Then you can use arrow keys to select the text you want. After selecting the text use Delete to delete the text. y to copy the text p to paste the text