Find a text inside multiple files in linux

Tuesday, February 22nd, 2011  »  Posted By  »  Total 0 Comment

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?

Wednesday, February 2nd, 2011  »  Posted By  »  Total 1 Comment

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

Wednesday, January 19th, 2011  »  Posted By  »  Total 1 Comment

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

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup

Email: