The term "grep" stands for "global regular expression parser". It's used to search a character stream for items matching a specific pattern.
The term "sed" stands for "stream editor". It's also capable of searching a character stream for items matching a pattern, but whereas grep just finds them, sed then actually does something to them to change them.
The major difference between SED GREP and AWK is that SED allows you to find a pattern address. AWK only allows you to find a numeric address.
The major difference between SED GREP and AWK is that SED allows you to find a pattern address. AWK only allows you to find a numeric address.
Grep
The difference between the grep family of utilities is based on what and how they search for patterns, from simple to complex. This also determines the speed at which they can analyze the patterns. fgrep works on a single string in a file grep uses regular expressions (one) to find patterns in a file or files egrep is an extended version (most complex) that finds multiple patterns in a file or files by using multiple regular expressions.
grep keyword filename Use egrep or fgrep for multiple keywords
You would use a pipe. For example. ls | grep cool The output of ls(the list of files in your current directory) is given to grep. Grep then finds and prints file names that include the word cool in them.
There are many different commands available in Linux. Some of the most basic are:* ls - lists the contents of a directory * dir - same as above but with escaped spaces * mv - move a file * rm - delete a file (semi-permanent) * cat - reads a file * less - used to pipe lengthy output from a command so that it can be scrolled through. Use like ls | less. * cp - copy files. cp file1 file1copy* grep - search for text in a file. Can also be used to search for words in a command output. Example: ls | grep partoffilename
$ cat /etc/passwd | grep username
The grep command is used to search for text, or lines containing certain words or strings of words. Stackoverflow, techonthenet, linux are a few sites that tell more about this command
grep -in '[aeiou]' filename.txt -i means to ignore case and -n will give you the line number that the vowel occurs in.
The man command of the Linux operating system is the system's documentation pager. Each page argument given to man is normally the name of a program, utility or function. For example, to see the reference manual of the grep program: man grep
edit ~/.bashrc file and add the alias you want : some more usefull aliases : alias l='ls -la' alias ls='ls --color=auto' alias dir='dir --color=auto' alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto'