How to get lines that contain string in a file?
In Linux, How do I display lines that contain a string in a text file, such as: search “my string” file_name How do I make the search case sensitive/insensitive? And how do I also display the line numbers? Regards Asked by alwbtc well grep -n “my string” file_name will do for your particular query. GREP is by default case sensitive in nature and to make it case insensitive you can add -i option to it. [...]
Continue Reading »Is there a way to grep with a constrained file type?
right now i am using something like this: find . -name “*.xml” | xargs grep -l “foobar” it works, but i was wondering if grep has this functionality built in? Asked by itfrombit 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. Answered by Mat Check more discussion [...]
Continue Reading »yum search – package version
How can I tell the version of a package after doing a yum search? e.g. yum search rabbitmq returns rabbitmq-server.noarch : The RabbitMQ server I need to know the version of this server. Asked by DD. 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 [...]
Continue Reading »Search and Domain in resolv.conf = slow lookups on Ubuntu
I have a machine running ubuntu 10.04 server. I’ve started getting long (5-10 second) delays when making connections to (some) sites outside of the LAN using tools like curl and wget. Using tcpdump and wireshark, I’ve found the problem to be in the DNS lookups that are being done to setup the connection: EXAMPLE When I run: wget www.site1.com I see the following behavior: LOOKUP: AAAA www.site1.com # => fail, no delay, site1 doesn’t have [...]
Continue Reading »How do I find files with “#” in their names, on Windows Server 2008?
I’m trying to locate all the files on my server which use a # as part of their name, and can’t seem to get the servers’ file search feature to restrict its result to only # files. How do I go about doing this? Asked by blueberryfields You can use cmd: dir *#*.* /s Answered by Mircea Vutcovici Check more discussion of this question. Bookmark on Delicious Digg this post Recommend on Facebook share via [...]
Continue Reading »On Unix on could I get a listing of all mp3 files inside a directory containing other directories with their full path?
Someone said to me use the find command but I’m not exactly sure how to do it. Basically I need this: suppose I have a folder called dir1 and it contains three sub-directories (dir2, dir3 and dir4 respectively) and suppose there might be mp3 files in all of the aforementioned directories. I would like to run a terminal command on dir1 that would search recursively through all the folders and list full paths of where [...]
Continue Reading »How to find a file that contains the specified string in FreeBSD?
I’m searching for the way to find a file that contains specified string text. It should be fast as possible but its not that important. I was reading the manual, and I’ve build something like that: grep my_string * -r and it works at all, but if there are many directories to search. Are there any other ways to find a file that contains specified string in FreeBSD? Did you mean: grep -rl my_search_pattern my_dir1 [...]
Continue Reading »Windows 7 search not showing results from mapped Server 2008 R2 share
I have a Windows Server 2008 R2 network share setup as a map drive in Win 7 x64. I want to search it via Windows 7 but I always get “no items match your search”. It’s as though it’s not even attempting to search. The File Server role with Windows Search Service is installed. The drive holding the network share is added to the indexing options on the server, and it indicates that indexing is [...]
Continue Reading »Is there an utility for editing the MS Search Server 2008 registry settings?
Microsoft Search Server 2008 and other MS serach products are tuned by editing the HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server12.0SearchSetupContentIndexCommon registry key. Is there an utility for doing the same? None that I know off. I search the last couple of days, trying to find a decent answer for you here. Found none. Check more discussion of this question. Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Print for [...]
Continue Reading »How can you search a sharepoint library using Windows 7 Search Federation?
I’d like to create a custom search provider for a sharepoint document library on Windows 7 Have a look at Create a Windows 7 Federated Search provider for SharePoint by Ian Morrish. This describes the OSDX file you need to create. Check more discussion of this question. Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Print for later Bookmark in Browser Tell a friend
Continue Reading »Recent Posts
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?
- Is there research material on NTP accuracy available?
- How to create a limited “domain admin” that does not have access to domain controllers?
- Can Windows RDC admin users be immune from being kicked?



