Grep – Exclude multiple directories and files while using grep search

Thursday, 14. June 2012


Files Matching search term excluding multiple directories and files with grep


Using grep to search for a text within files recursively

Thursday, 14. June 2012

To search for text in files from the current folder recursively. you can :

grep text_to_search -R . -n --include=*.php --color

The parameters are as follows:

the actual text to search for

Recurse to subdirectories

start from the current directory

specifies a regular expression that searchable files must match (in my case, search only files with the ‘php’ extension)

makes the output pretty

shows the lines numbers of the lines that matched your search text

Launch Gnome Terminal and execute a command in debian linux

Sunday, 10. June 2012

A snippet you would need to launch a terminal command (gnome terminal) and execute a command line

gnome-terminal -e "ssh [email protected]"