Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 11-26-2013, 08:08 AM   #1
Gosu89
New Member
 
Join Date: Nov 2013
Posts: 3
Gosu89 is on a distinguished road
Need help useing grep

I was wondering how do I grep stuff in the putty?
Gosu89 is offline   Reply With Quote
Old 11-26-2013, 08:45 PM   #2
Pymeus
Member
 
Join Date: Oct 2008
Home MUD: tharel.net
Posts: 36
Pymeus is on a distinguished road
Re: Need help useing grep

Grep is mainly a command-line regular expression matcher. If you don't know regular expressions, start out using -F (see below) for fixed string matches. If you're looking to learn, the -P PCRE (perl-like) regular expressions are IMO both the most useful and the easiest to get the hang of.

The basic usage is
Code:
    grep <options> 'REGULAR EXPRESSION' 
    grep <options> 'REGULAR EXPRESSION' file1 file2 file3...
Different regex types
Code:
    grep -G 'POSIX REGULAR EXPRESSION (DEFAULT)' file1 file2 file3...
    grep -E 'EXTENDED POSIX REGULAR EXPRESSION' file1 file2 file3...
    grep -P 'PCRE REGULAR EXPRESSION' file1 file2 file3...
    grep -F 'FIXED STRING' file1 file2 file3...
There are many more options. Some of the most notable are -i (case insensitive), -v (match lines that DON'T match the pattern), -l (list only the names of files that contain a match), and -R (recursive).

Grep manual: UNIX man pages : grep ().

Maybe you have some more specific questions?
Pymeus is offline   Reply With Quote
Reply


Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 12:36 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014