Sponsored Content
Top Forums Shell Programming and Scripting delete entry from /etc/hosts file ? Post 302247823 by hcclnoodles on Thursday 16th of October 2008 11:51:42 AM
Old 10-16-2008
its ok, worked it out
Code:
perl -pi -e "s,^10.10.10.1.*my_server1\n$,," /etc/hosts

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to edit file and delete entry

Can anyone provide me a shell script to edit a xml file and delete one entry. To do manually i can edit(vi editor) the file and 'dd' will delete the file.But I wiluld to know if I can do with a script. Thanks in advance Tannu (6 Replies)
Discussion started by: tannu
6 Replies

2. UNIX for Dummies Questions & Answers

Hosts.deny entry

Hello I want to block individuals who attempt to use ssh to loggon to one of my machines from a certain IP address. I added the following entry in hosts.deny. Will the entry do what I want to do? ssh: 202.111.128.225 (3 Replies)
Discussion started by: mojoman
3 Replies

3. Red Hat

entry in /etc/hosts

Hello all, I´m on Red Hat Enterprise Server 4.5 I´m wondering if it is possible to disable the need to add every IP machine entry in the file /etc/hosts to allow it to connect to Red hat? I´m getting "where are you?" message. This is solved adding the machine ip where I´m working. Thanks in... (1 Reply)
Discussion started by: mig28mx
1 Replies

4. UNIX for Dummies Questions & Answers

Compare these two lines and delete the old entry

I have a unique situation here which looks easier at first but I am not able to solve it. # SSort UNIX 10/14/2005 10/13/2010 "tox" "9000/800" 16 * * * V849-6-1 # SSort UNIX 11/31/1996 11/02/2010 "tox" "9000/800" 16 * * * W237-S-2 I have a text file with two or multiple values like this and... (1 Reply)
Discussion started by: pareshan
1 Replies

5. IP Networking

Hosts file ignored, no DNS entry but still routes!!

Hi all, I have an entry in my hosts file on a server called tractor as follows: 10.67.34.128 digger-m2m digger I have a DNS server configured but it doesn't seem to know about digger. When I do an nslookup on tractor for digger i get the following: new_dns1.oam.uk can't find digger: Non... (0 Replies)
Discussion started by: Donkey25
0 Replies

6. Shell Programming and Scripting

Need to delete duplicate lease entry

Hi *, I need to delete duplicate lease entries in file according to MAC/IP. I'm having tempfile which contains many lease info and need to have one entry for each IP(not more than that), if it contains more than one entry for same set, need to be deleted that entry... EX: lease... (4 Replies)
Discussion started by: SMNK
4 Replies

7. UNIX for Dummies Questions & Answers

Not able to delete this file/directory/entry

Hello UNIX gurus, I noticed this file or whatever in one of our directories, and somehow I am not able to proceed with my work, without deleting this one. .insert--- 1 siebload intrface 0 Feb 22 01:25 Testfile I am confused, as it doesnt appear to be a file, and on doing any... (2 Replies)
Discussion started by: ppathak1234
2 Replies

8. Shell Programming and Scripting

Checking crontab job entry in 3 different hosts

Hi Gurus, I am trying to connect to remote host from current host to check crontab entries. I have started like this ssh -n -l db2psp 205.191.156.17 ". ~/.profile >/dev/null 2>/dev/null; cd log ;ls | wc -l" I got this error ? ssh: connect to host 205.191.156.17 port 22:... (1 Reply)
Discussion started by: rocking77
1 Replies

9. How to Post in the The UNIX and Linux Forums

Help me, write a bash script to delete parent entry with all their child entry in LDAP UNIX server

Hi All, Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries. example: Parent is : ---------- dn: email=yogesh.kumar@wipro.com, o=wipro, o=in child is: ---------- dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Discussion started by: Chand
1 Replies

10. Solaris

How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh. Actions to perform within a single ssh session via shell script - copy a file - untar at destination (remote host) OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies
bcfg2-reports(8)					      System Manager's Manual						  bcfg2-reports(8)

NAME
bcfg2-reports - Query reporting system for client status SYNOPSIS
bcfg2-reports [-v] DESCRIPTION
bcfg2-reports allows you to retrieve data from the database about clients, and the states of their current interactions. It also allows you to change the expired/unexpired states. The utility runs as a standalone application. It does, however, use the models from /src/lib/Server/Reports/reports/models.py. OPTIONS
-a Shows all hosts, including expired hosts. -b NAME Single-host mode - shows bad entries from the current interaction of NAME. NAME is the name of the entry. -c Shows only clean hosts. -d Shows only dirty hosts. -e NAME Single host mode - shows extra entries from the current interaction of NAME. NAME is the name of the entry. -h Shows help and usage info about bcfg2-reports. -m NAME Single-host mode - shows modified entries from the current interaction of NAME. NAME is the name of the entry. -s NAME Single host mode - shows bad, modified, and extra entries from the current interaction of NAME. NAME is the name of the entry. -x NAME Toggles expired/unexpired state of NAME. NAME is the name of the entry. --badentry=KIND,NAME Shows only hosts whose current interaction has bad entries in of KIND kind and NAME name; if a single argument ARG1 is given, then KIND,NAME pairs will be read from a file of name ARG1. KIND is the type of entry (Package, Path, Service, etc). NAME is the name of the entry. --extraentry=KIND,NAME Shows only hosts whose current interaction has extra entries in of KIND kind and NAME name; if a single argument ARG1 is given, then KIND,NAME pairs will be read from a file of name ARG1. KIND is the type of entry (Package, Path, Service, etc). NAME is the name of the entry. --fields=ARG1,ARG2,... Only displays the fields ARG1,ARG2,... (name, time, state, total, good, bad) --modifiedentry=KIND,NAME Shows only hosts whose current interaction has modified entries in of KIND kind and NAME name; if a single argument ARG1 is given, then KIND,NAME pairs will be read from a file of name ARG1. KIND is the type of entry (Package, Path, Service, etc). NAME is the name of the entry. --sort=ARG1,ARG2,... Sorts output on ARG1,ARG2,... (name, time, state, total, good, bad) --stale Shows hosts which haven't run in the last 24 hours SEE ALSO
bcfg2(1), bcfg2-server(8) BUGS
None currently known bcfg2-reports(8)
All times are GMT -4. The time now is 12:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy