Uso del comando EGREP
domenica 31 gennaio 2010
La sintassi del comando EGREP è:

egrep options pattern filenames.


Esempi:

1) Cerca tutte le stringhe che contengono la parola body all'interno del file /etc/passwd

$ egrep '[a-z]+body' /etc/passwd
nobody:x:60001:60001:NFS Anonymous Access User:/:
nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:

2) Cerca la stringa Network Admin e la stringa uucp Admin nel file /etc/passwd

$ egrep '(Network|uucp) Admin' /etc/passwd
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
listen:x:37:4:Network Admin:/usr/net/nls:
















postato da Eduardo Kislanski @ 12:04  

0 Commenti:

Posta un commento

<< Home page

MARVEL and SPIDER-MAN: TM & © 2007 Marvel Characters, Inc. Motion Picture © 2007 Columbia Pictures Industries, Inc. All Rights Reserved. © 2007 Sony Pictures Digital Inc. All rights reserved.