Every developer needs a find string script
Well here is my find string for php files.
Create a new file (bash script)
$ sudo gedit /usr/bin/fsp
Add these lines
#!/bin/bash
clear
echo "fsp - Find string recursivly from current directory in PHP files. -i = case insensitive";
echo "";
echo "find ./ -name '*.php' xargs grep -i \"$1\"";
echo "";
find ./ -name '*.php' xargs grep -i "$1";
echo "";
And don't forget to set file to be executable!
sudo chmod +x /usr/bin/fsp
Now try it out,
cd ~/development/project
fsp "search for something in your php files!"
Create a new file (bash script)
$ sudo gedit /usr/bin/fsp
Add these lines
#!/bin/bash
clear
echo "fsp - Find string recursivly from current directory in PHP files. -i = case insensitive";
echo "";
echo "find ./ -name '*.php' xargs grep -i \"$1\"";
echo "";
find ./ -name '*.php' xargs grep -i "$1";
echo "";
And don't forget to set file to be executable!
sudo chmod +x /usr/bin/fsp
Now try it out,
cd ~/development/project
fsp "search for something in your php files!"
Comments