Hi,
aus einem bestimmten Grund muss ich wissen ob irgendwo auf meinem Server noch eine bestimmte IP-Adresse steht.
Nehmen wir mal an ich suche die IP-Adresse 123.123.123.123, wie muss da der Suchstring lauten?
Das beste wäre wenn das Ergenis in ein File ausgegeben werden könnte...
Hoffe auf baldige Antwort, Danke!
Gruss
Bingo
Gesamten Server nach einem String durchsuchen...
-
- Posts: 88
- Joined: 2002-08-21 06:01
- Location: Hannover
-
- Userprojekt
- Posts: 7066
- Joined: 2002-10-09 14:30
- Location: Dorsten
Re: Gesamten Server nach einem String durchsuchen...
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
-
- Posts: 88
- Joined: 2002-08-21 06:01
- Location: Hannover
Re: Gesamten Server nach einem String durchsuchen...
Danke!
Problem ist nur das er bei /dev/ hängen bleibt...
Kann man den Befehl noch ändern so das er nicht in /dev/ sucht?
Gruss
Bingo
Problem ist nur das er bei /dev/ hängen bleibt...
Kann man den Befehl noch ändern so das er nicht in /dev/ sucht?
Gruss
Bingo
-
- Userprojekt
- Posts: 7066
- Joined: 2002-10-09 14:30
- Location: Dorsten
Re: Gesamten Server nach einem String durchsuchen...
Code: Select all
find / --exclude=/dev --exclude=/proc | grep STRING
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
-
- Posts: 88
- Joined: 2002-08-21 06:01
- Location: Hannover
Re: Gesamten Server nach einem String durchsuchen...
Hi,
find: invalid predicate `--exclude=/dev'
Gruss
Bingo
folgende Fehlermeldgun bekomme ich:CaptainCrunch wrote:Code: Select all
find / --exclude=/dev --exclude=/proc | grep STRING
find: invalid predicate `--exclude=/dev'
Gruss
Bingo
-
- Posts: 172
- Joined: 2002-06-19 07:06
Re: Gesamten Server nach einem String durchsuchen...
Das findet Dateinamen, die die IP Nummer enthalten, ist aber nicht das, was bingo will.CaptainCrunch wrote:Code: Select all
find / --exclude=/dev --exclude=/proc | grep STRING
Versuchs mal mit:
Code: Select all
find /bin /boot /etc /home /opt /root /sbin /tmp /usr /var -type f -exec grep 123.123.123.123 {} /dev/null ; > fileliste
-
- Posts: 88
- Joined: 2002-08-21 06:01
- Location: Hannover
Re: Gesamten Server nach einem String durchsuchen...
Danke, das war es!
Hat mir super geholfen, Danke nochmal...
Guten Rutsch ins neue Jahr...
Gruss
Bingo
Hat mir super geholfen, Danke nochmal...
Guten Rutsch ins neue Jahr...
Gruss
Bingo
-
- Project Manager
- Posts: 11186
- Joined: 2003-02-27 01:00
- Location: Hamburg
Re: Gesamten Server nach einem String durchsuchen...
Code: Select all
grep -l -r -D skip -E "(123.123.123.123)" /{bin,boot,etc,home,opt,root,sbin,tmp,usr,var}/* > /result.txt
Code: Select all
for file in `grep -l -r -D skip -E "(123.123.123.123)" /{bin,boot,etc,home,opt,root,sbin,tmp,usr,var}/*` ; do
cp -f ${file} ${file}.bak
sed -e 's@123.123.123.123@321.321.321.321@g' ${file}.bak > ${file}
rm -f ${file}.bak
done
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.