General :: Search For A File In Multiple Machines Simultaniously?
Sep 15, 2010
Im new to the forum and fairly new to Linux as well. my apologies if this is posted in the wrong section. My problem is How can you search for a file in multiple machines (like a server farm) ? For example i log onto machine num1 and want to search for a file named "xxx.yyy" which may be in one of 4 machnies. What i do right now is manually log into each machine and run the find command. However i have heard that it is possible to do it via a couple of simple commands. I have looked into pssh and cssh as well as ssh tunneling (along with public key authentication to stop the machines requesting a password every time i log in) and unfortunately i was unable to find an answer.
for example we search a file for a certain keyword..is there any application available which will enable us to search for a single keyword in all the files within the folder ?i want to search for a keyword in about 1000 files..if i do it manually it will take loads of time..
How to search multiple words in multiple lines, inside a directory including sub-directory? Pls. give easy example. I want to search the files (in /xx folder and all subfolders) that have header.h included and used x() function. I tried $grep -r "header.h" | grep -r "x(" /Folder/subfolder/ > search.log
Does anyone know of a way to perform a search for multiple file extensions at once in Gnome? I know that M$ Windows Explorer had this capability, but I'm just not sure how to do it in Gnome, or if it's possible. I just want to be able to perform searches for Video, Music, and Document file types, without having to perform a separate search for each file extension. Example: When doing a search for Video file types (.avi,.mp4,.mov,.wma, etc.), I would like to do one search for all files that have these file extensions, instead of doing one search for .avi files, a second search for .mp4 files, another for .mov files, etc.
Two machines connected via LAN Older machine is running RedHat 3 Kernel 2.4.21-50.ELsmp on i686 Newer machine is at a current level of SUSE Linux. Newer machine has a DVD drive. Here's the question. Is it possible to, remotely, mount the DVD device to the older machine? If so, can it be used to install software packages?
I have a network of 20 machines, all running Ubuntu 10.04.
Each machine has about 200[GB] of data that I'd like to share with all other 19 machines for READ ONLY PURPOSES. The reading should be done at the FASTEST POSSIBLE WAY.
A friend told me to look into setting up HTTP / FTP. Is it indeed the optimal way to share data between the machines (better than NFS)? if so, how do I go about it?
UPDATE: Just to clarify, all I want is to be able (from within machine X) to access one of machine Ys files and LOAD IT INTO MEMORY. all of the files are of uniform size (500 [KB]). Which method is fastest (SAMBA / NFS / HTTP / FTP)?
i have 30 linux PCs running. i need to check the performance of all pcs( memory,ram and process usage) in single command or in GUI mode.In solaris we have perf script to check performance in GUI mode. i need same type in linux?
Long story short, I got a folder with nearly 800,000 php files. I would like to search each file for a string and if it exists in that file, the file gets copied to another directory. Is this possible from the terminal? So far I got: grep -i -n -r 'ppr-1792' * | cp $1 move_to_here
But this obviously doesn't work. $1 needs to be the file name that contains matching text.
Hello, I need some help searching through multiple files, finding a line and replacing that line. The line I am searching for is:
password key ******* 1222554
ultimately I want to be able to delete the numbers after the asterisks . my thoughts are to create a script that will search for the line password key ******* and delete it then replace it with password key ******* my files are located in /opt and they are all txt files.
I'm fairly comfortable with emacs but I can't seem to find how to do this. I deal with a lot of text files and find myself performing a lot of regular expression replacements to correct the formatting of the text -- or to extract certain tidbits of data from large ugly-looking files.
I know how to perform a regular expression replacement in one buffer at a time. But how do you perform a regular expression search and replace across all open buffers? I have found a method to perform a regex search and replace across a directory by marking files but I need to do it in the open buffers.
But the problem is that in this case i just wanted to append "/home/dest" for which I could easily escape "/" with just two "", but I wonder if i have a long path like "/a/b/c/d/e/f/g/h/i/j" I will have to escape so many /. Is there any other way by which I can avoid escaping forward slash.
I tried following:
But receiving follo error
Bareword found where operator expected at -e line 1, near "s/destination-path=/'destination-path=/home" syntax error at -e line 1, near "s/destination-path=/'destination-path=/home" Bad name after dest' at -e line 1. tried with enclosing in double quotes as well but in vain
I just installed ubuntu 10.04 x64. I have installed it and set it up the way I like on my server, however I now have 3 terminals and a laptop to set it up on the exact same way. As a result Id like some advice on what can and cant be done and how. Preferably I am looking to use programs with GUIs. Thing the style of ubuntu one, software manager etc, not really too into the command line, or conf editing unless there is no other option.
1. I installed all the software from software centre I like. Now I need the same software on the other computers. I know mint has mintbackup where it just exports and imports a list if installed software. I am looking for an ubuntu equivalent.
2. Firefox and Thunderbird add-ons. I install like 20 firefox and thunderbird add ons. sometimes I can't even keep track of them. There must be a way to sync them so that each computer I install ubuntu on I can simply import the list of mozilla add ons and have it auto download them.
3. Mail Contacts and Calender Syncing. I need to sync between my 3 ubuntu machines and my windows mobile 6.5 device for calender, email/phone/name contact lists. Email is taken care of by imap, but lightnings calender isnt and neither are the contacts. If I input a contact on my phone I want it to sync to the other computers I use.
4. Ubuntu one. I have /storage/workfolder in my root directory on my personal server. I want to be able to work on documents at work on my laptop and sync them so that when I get home, they are synced on the server without causing overwrite changes etc.
5. Desktop settings, icon themes, preferences from ubuntu tweak etc. I know this one is a bit more of a long shot, but it takes 20 minutes each computer, to set up the little maximize minimize buttons on the other side, set up cairo dock the way I like, install the icon theme and backgrounds I like. isnt there a way to back this up so it doesnt have to be done each time or so I can make my other computers the same?
I have a few servers that are exposed to the internet. When someone tried to brute force hack in to the ssh, ossec adds their IP to the hosts.deny. Then the hacker (read: script kiddie) moves to the next IP up the line and hits my next server, etc, etc.
I end up getting 20 emails for all the servers that they hit.
My question, is there anyway to sync the hosts.deny file across multiple servers so that if they are locked out of one, they are locked out of all?
utility to let me automatically apply shell commands I type to a list of given remote machines? I'm configuring and maintaining multiple servers all running Fedora 12 and I want them to have exactly the same configuration. I also need to check out code from subversion onto these machines; the same code from the same location into the same directory. I know I could use ssh to run each command individually for each machine, but is there a tool that will make this much easier?
run a cron job to download my email logs to my laptop. But the question is HOW? Im not sure how to write the php script for the cron job. the file is on "computer A" and the file is setup to chmod I just need to know how to write the php to "access" the other computer and then download the file to a certain file on my laptop.
recommend a utility to let me automatically apply shell commands I type to a list of given remote machines?I'm configuring and maintaining multiple servers all running Fedora 12 and I want them to have exactly the same configuration. I also need to check out code from subversion onto these machines; the same code from the same location into the same directory. I know I could use ssh to run each command individually for each machine, but is there a tool that will make this much easier?
I have a doubt, i have a file which contains around 3000 elements, now i want to search for an element in that file.what will be the Efficient way of searching ? without consuming much memory and time..
1) is this efficient if i take all the 3000 elements from file to a list or array and sort them and search ? 2) or is it efficient to search directly inside the file ?? Can anyone please suggest some algorithms for an efficient way to search in this case ?I am using C for coding..
I have a home network with 6+ x86_64 machines, all with similar setups. In the past (FC10 and before), I've had common package repositories (e.g /var/cache/yum/fedora/packages) shared via NFS with all the machines (and with keepcache=1 in /etc/yum.conf). That way, a given RPM only got downloaded once; the other machines would then pull it from my local package repository. And I don't mind the disk usage of keeping one copy of all my old RPMS around.
It seems that while DRPMS is great for a single machine, it doesn't make sense in my case. If I have to download the DRPM 6 times (and take the time/CPU hit to recreate the RPM 6 times), I might as well have downloaded the RPM once and been done with it. Is there a not-too-convoluted method to keep a common package repository across multiple machines even with DRPMS? Or, better, to have that first downloading machine pull a DRPM, generate the RPM, then save the RPM in the local shared repository?
I'm trying to write a script that will prompt the user for a username/password, then create that user/password in the right groups on all my machines. I know this is kind of a long way around to avoid a NIS server, but I like making my life more difficult.
This is what I have so far:
Code:
the script has 2 problems: The "if" functions return an error and do not compare the strings successfully. whatever password is entered does get applied properly and the user is unable to login
I am trying to get preseed working on a bunch of machines with multiple NICs but it doesn't pick the right interface and/or gets "no link" on all interfaces. My PXE kernel line looks like so (I have auto=true priority=critical and interface=auto)
I have three Ubuntu desktops that I would like to upgrade from 9.10 to 10.04. Is there a way to avoid having each PC download the same packages? Is there some magic I can do with two of the PCs to maybe point the software source list at the third 'master' PC that does all the downloading?
total newb here. call me a script kiddie if you want but here is what i need to do and what i have.
need to:search a hidden log file for a specific string, find what comes after that part, and then output the result to a variable or something that can be used by an application or other script to carry out further actions.
The requirement was to write a shell script for a cron job set for every two hours for all days.The Script has to scan log files (*.log) for the logs posted only for the last two hours.... and append them in a new file...I am clueless abt how to scan/compare based on time stamp seen in above logs.
I used locate cmd to search file abc.txt (for example) as I didn't know in which directory it would be present and couldn't find it. But when I did find . -name abc.txt, it traced the file, luckily the file was in the same directory. I am wondering how find was able to search abc.txt and locate not. How these two are behavinb differently? Usually I use locate when I don't know the path to the parent dir.