Tag Info

Hot answers tagged

28

My version of GNU Grep has a switch for this: grep -R foo --include '*.txt' * "--include=GLOB Search only files whose base name matches GLOB (using wildcard matching as described under --exclude)."


12

You can find the version number of a package in your repositories with the yum info command. # yum info rabbitmq-server Available Packages Name : rabbitmq-server Arch : noarch Version : 2.6.1 Release : 1.fc16 Size : 1.1 M Repo : updates Committer : Peter Lemenkov <lemenkov@gmail.com> Committime : Tue Nov 8 ...


11

If you have a large number of files it would be useful to incorporate xargs into the command to avoid an 'Argument list too long' error. find . -name '*.txt' -print | xargs grep <pattern>


10

dsquery user -stalepwd 60 Returns a list of all users with a password age of 60 days or more.


10

It appears to work by doing this: vbscript site:serverfault.com OR site:stackoverflow.com Of course, this could be a false positive and would require further testing Edit: It definitely works, as demonstrated in the Results Summary: Results 1 - 10 of about 9,080 from serverfault.com OR stackoverflow.com for vbscript. (0.06 seconds)


9

Find does not need an index, and traverses the disk every time you run it. Example $ find / -name "*mynewprogram*" locate and variants need index files, but they work -really- faster. 'locate' is from GNU findutils. 'slocate' was recommended up to etch; it was a more 'secure' version of locate, users will not see files that they do not have acess to. ...


8

I'm assuming you're doing this from a Windows machine to Windows machines. I'd do something quick and dirty like: Machines.TXT COMPUTERNAME-1 COMPUTERNAME-2 COMPUTERNAME-3 Scan-Machines.cmd @echo off if "%1"=="" goto all echo Scanning %~1 dir "\\%~1\c$" /s /a /b > "%~1.txt" goto end :all for /f "delims=" %%i in (Machines.TXT) do call %0 "%%i" :end ...


8

This is what I use: for GUI grepWin: link text for superfast commandline: gsar.exe from link text


8

Per my comment, I don't believe there is an equivalent to the "packages.debian.org" central package archive (with web interface) in CentOS. It's something I think is really missing!


7

POSIX grep doesn't have such options, but coreutils grep does. grep -r --include='*.xml' -l foobar . should do it. FreeBSD grep (and OS X) appear to have the same thing, Solaris & AIX lack them AFAICT.


7

You should enable it globally, otherwise you'll be vulnerable to the situation where an attacker modifies the unencrypted form to send all the user data to evilserver.com rather than to the one you want (or, since the attacker is actively listening, modify the form action to use HTTP instead of HTTPS). You may also get into a configuration headache ...


7

cat is unnecessary (UUOC!) grep will normally tell you which file the matched line was found in when used like this: grep some_string_here *.xml You can also use the -H switch to always to this: grep -H some_string_here *.xml


7

I usually chain greps to do this. grep uploaded $file | grep -v 09


7

Yes, 'this' is included in the list of default stop words. Please see the section titled solr.StopFilterFactory in the docs. Please also see the solr.KeepWordFilterFactory section.


6

You could use grep: grep -rn 'classname' /path/to/source This will also print the line number next to each match. Case insensitive: grep -rin 'classname' /path/to/source Search non-recursively in all cpp files: grep -n 'classname' /path/to/source/*.cpp


6

I use xobni with my desktop Outlook and really like it. I believe Outlook needs to be in cached mode


6

Looking through the courier imapd docs and my installs of it it doesn't seem to have a cache or index of anything beyond the uids of the messages. Have you looked at dovecot? It looks like you can migrate to it without users noticing. It also has a discussion of how it cache's various bits of information in message database. All that being said, a ...


6

Solr, from the Apache Lucene project. Excerpt from the web site http://lucene.apache.org/solr/ Solr is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, a web administration interface and many more features. It runs in a Java servlet ...


6

You query INFORMATION_SCHEMA.TABLES for all the tables then query each table. See http://stackoverflow.com/questions/593746/sql-to-search-the-entire-ms-sql-2000-database-for-a-value for details. JR


6

I'd say give WinGrep a shot.


6

GNU grep has the -L option, the inverse of -l. It lists files with no matches. So you can do grep -iL v=spf *.db With a more traditional grep, you can do a -c count and then select the ones that have a count of 0 matches: grep -ic v=spf *.db | grep ':0$' | sed 's/:0$//'


5

For search volumes of that size, I've used a Google Search Appliance. They can be expensive, but they are very customizable and they do an incredible job of indexing things. As a bonus, it will not only index file shares, but you can point it at web resources as well for indexing.


5

2 options I've used: Open computer, select C:, in the top right you have a search box, put in . and click on Size under search filter, select Gigantic. Or install Space Sniffer


5

Do you need to quickly search your filesystem for a string just once? Or is this something you need to do all the time? Because if it's just once, you might as well just use grep -- the time it takes grep to search through everything won't be any slower than the time it takes to build an index. If this is actually something you find yourself doing ...


5

In Powershell, single quotes ' indicates variable expansion should not happen within the string. You should try with the double quotes " instead: Get-QADComputer -NotLoggedOnFor 90 -SearchRoot "doman.name/OU1/$OU2" From the docs: PS C:\> Get-Help about_Quoting ... SINGLE AND DOUBLE-QUOTED STRINGS When you enclose a string in double quotation ...


5

Yes, see the "git grep" command


5

The basename command will give you just the name of the file and not the full path, which you can execute on your found file like this: find . -name filename -exec basename {} \;


5

Here's an article from AnandTech where they open up the Google mini. There's a couple of awkward screws in the front to remove that have no usable screwhead...


5

If you have powershell installed you could use select-string -pattern <your_string> -path <path_to_file> It probably won't be fast, but won't choke like find or findstr probably will.



Only top voted, non community-wiki answers of a minimum length are eligible