Searching for HOST NAME in UNIX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Searching for HOST NAME in UNIX
# 1  
Old 06-28-2006
Question Searching for HOST NAME in UNIX

Hello,

I am new to UNIX OS and I am planning to learn on how to use it since I was granted with the joy of being responsible of SCO UNIX on our network :-)

So, can someone please tell me how to search for a particular string on our UNIX box specifying a server name...???

For some reason when I try to launch the backup exec agent it tells me that it fails to communicate with a server for which it does not exist on the network, it has been retired.

I have modified the hosts file to point to the new server; but still the same thing. I also rebooted which that did not help...

Any thoughts?? Smilie Smilie
# 2  
Old 06-29-2006
try to look into the backup agent conf file, the hostname of the backup server could be specified in there.

or use grep

$ grep -r hostname *
# 3  
Old 06-29-2006
try this....

echo `hostname`
# 4  
Old 06-29-2006
Thank you for the replies; but there is nothing in the config file that represents the hostname Smilie Smilie

I also tried grep -r but that errors out. I can use grep but not sure how to use the command switches to search for the string...

Can you please guide me since I am a newbie to this stuff...

Your help is much appreciated.

Thanks!
# 5  
Old 06-29-2006
OK,

I understand the part using GREP to search for particular strings in a file. Is there something out there where I can search within folders of files for string patterns?

Your help is appreciated!

Smilie
# 6  
Old 06-29-2006
Code:
find /path/to/top_folder  -name '*' -exec grep -l  'mypattern' {} \;

This will list the filenames that have the pattern you want to search for.
It will search all of the sub-folders. In UNIX they are usually called directories Smilie
# 7  
Old 06-29-2006
MySQL

Smilie Thank you all, I am all set!

Smilie Appreciate the help!


Smilie Smilie Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Best performance UNIX just for HOST Virtualization?

Hi everybody, Which Unix base OS have best performance for HOST virtualization? I tested SmartOS but it needs another OS to connect remotely! Thanks in advance. (11 Replies)
Discussion started by: mbzadegan
11 Replies

2. UNIX for Dummies Questions & Answers

UNIX script to use ssh to host

I am doing an old-school command to get an inventory to many host using ssh thru Solaris machine. Please help me find a way thru script to get this automized. This will make me lazy but will surely benefit out of it. thanks in advance. Process I am doing: Host IPs (examples): 10.210.1.2... (1 Reply)
Discussion started by: TripleHar
1 Replies

3. UNIX for Dummies Questions & Answers

Not sure if UNIX is searching for files or not?

I am very very new to Unix, working on a shell script for my job and was just trying to come up with the correct find command. I get a > symbol on a new line. I can't exit the program either, it will not go back to the $. I am using Cygwin. I don't know if this means no result, or if the fact none... (3 Replies)
Discussion started by: kimberlyg2007
3 Replies

4. Shell Programming and Scripting

sftp to UNIX host

Hi, I am writing a shell script that securely connects to an UNIX host and transfer file(abc.txt) from the local machine to the host. sftp user@host get abc.txt bye The code doesn't work.. It throws error at line 2: get :Unknown get command. How can I rectify this problem? (2 Replies)
Discussion started by: Kishore_1
2 Replies

5. Shell Programming and Scripting

Searching the web...unix

Hello, I am writing a command that uses a search-motor in a website... my code is : lynx -dump "http://www.theweathernetwork.com/index.php?product=search&pagecontent=results&prodtype=city&prodname=$1"|grep $1|head -1000>>temp.txt so if the user types myprogram.sh nameofTheCity: it... (0 Replies)
Discussion started by: andrew1400
0 Replies

6. Solaris

ILOM to unix host

Hello- On Solaris 10g x86 - I had two IP addresses , one for unix host (connecting through putty) and one for ILOM (connecting through CLI and web). I had to perform some changes in FS sizes etc, did that on unix host and executed command 'init 6' remotely for them to take place. But, the unix host... (30 Replies)
Discussion started by: panchpan
30 Replies

7. SCO

Searching for Unix bootdisk

Hello. I need to reinstall my Unix Open Server Release: 5 on my Compaq proliant 800, but, my floppy bootdisk Release:5.0.4 is bad. Where can I download that version. That release of Unix is no longer supported by SCO. Thanks. (4 Replies)
Discussion started by: Junior Rod
4 Replies

8. UNIX for Advanced & Expert Users

Unix / Host explorer

Anyone know where I can get a download of a unix / aix explorer (pref with X-Windows) to run from Windows XP, as I transfer files between the two systems on a frequent basis. (3 Replies)
Discussion started by: gefa
3 Replies

9. Solaris

Unix virtual host detection

Is it possible to reliably detect the virtual host of a Sun Solaris box, within a shell or Perl script? Can a system have multiple virtual host or not host at all ? I was recently made aware of hostname command, but was not sure if this option was the only one available. Any help is much... (3 Replies)
Discussion started by: Meridian
3 Replies

10. Solaris

Unix virtual host detection

I have a need to write scripts that can reliably determine the virtual host of a Sun Solaris system. (1 Reply)
Discussion started by: Meridian
1 Replies
Login or Register to Ask a Question