Search Debian Package
Show all deb packages with the name “httpd”
dpkg -l | grep httpd
Show all deb packages with the name “httpd”
dpkg -l | grep httpd
Grep that searches recursively, ignores binary files, and doesn’t look inside Subversion hidden folders.
grep -Ir --exclude="*\.svn*" "pattern" *
Search files created or changed within 10 days
find /usr/bin -type f -mtime -10
View only lines that contain the word “string”
sed -n '/string/p'
Search string “test_text” at directory ‘/var/log’ and below
grep test_text -R /var/log/*
Recursively check a folder to find the given text using grep
grep -R "text" *
Search for a specific text in a folder using grep
grep "fetchFeedPacksCustomize()" *.js
[tags]grep,search,text,folder[/tags]
The search that limits the results to just directory listings…
intitle:”index.of” inanchor:”Last Modified” inanchor:”Description” inanchor:”Parent Directory” -filetype:php -filetype:asp -filetype:htm -filetype:html -inurl:”index.of” search.string
Use find and grep to search for a specific text in a directory. In this example, we search for files which uses the PHP short tag – <?
find -name '*.php' -exec grep '<?[^p\=]' {} \;
Recoll is a personal full text search tool for Unix/Linux. It is based on the very strong Xapian backend, for which it provides an easy to use, feature-rich, easy administration, QT graphical interface.
su -
[Enter Password]
cd /etc/yum.repos.d/
wget http://www.xapian.org/RPM/xapian.repo
yum install xapian-omega xapian-bindings-php xapian-bindings-python xapian-bindings-tcl8
cd ~
wget http://www.lesbonscomptes.com/recoll/recoll-1.8.1.tar.gz
tar -xzf recoll-1.8.1.tar.gz
cd recoll-1.8.1
./configure
make
make install
[tags]recoll,software,install,linux,command,cli,search,application,beagle[/tags]