
- Kali Linux Tutorial
- Kali Linux - Home
- Installation & Configuration
- Information Gathering Tools
- Vulnerability Analyses Tools
- Kali Linux - Wireless Attacks
- Website Penetration Testing
- Kali Linux - Exploitation Tools
- Kali Linux - Forensics Tools
- Kali Linux - Social Engineering
- Kali Linux - Stressing Tools
- Kali Linux - Sniffing & Spoofing
- Kali Linux - Password Cracking Tools
- Kali Linux - Maintaining Access
- Kali Linux - Reverse Engineering
- Kali Linux - Reporting Tools
- Kali Linux Useful Resources
- Kali Linux - Quick Guide
- Kali Linux - Useful Resources
- Kali Linux - Discussion
Difference between grep and fgrep command
In any language or framework one of the most important and main feature is of searching the data. It not only denotes the performance of language but also represents in what manner the data is being stored. So specifically if we take an example of LINUX operating system there comes two of the important commands namely grep and fgrep.
Both of these commands are used to search any string or regular expression in file, directory or even in multiple folders. Both these commands executes in such a way that processor starts analysing the target folder or destination and search for the given string or data.
On the basis of execution of both of these commands following are the important differences.
Sr. No. | Key | grep | fgrep |
---|---|---|---|
1 | Definition | grep or Global Regular Expression Print is the command in Linux which can search for any type of string on any file or list of files or even output of any command. | On other hand Fgrep or the Fixed grep or grep -F is command in Linux which is again used in searching for the entire string instead of regular expression as it doesn’t recognize the regular expressions neither any meta-characters. |
2 | Implementation | For introducing the support of regular expression in search mechanism grep command is implemented in such a way that it consider regular expression and also meta-characters in the given search string and perform search along with them treating as separate than normal characters of the string. | On other hand implementation of Fgrep does not support regular expression or any meta-character in its search and treat them as part of normal characters of the string. |
3 | Data Searching | For data searching grep uses Boyer-Moore algorithm for fast searching any string or regular expression. | On other hand fgrep always uses the Aho-Corasick algorithm that worst O(m+n) complexity. |
4 | Regular Expression | As mentioned above grep always interpreted as regular expressions in the given string for search. | On other hand fgrep command interprets the PATTERN as a list of fixed strings separated by newlines. |
5 | Syntax | Syntax for grep command would be in form of "grep "." myfile.txt" | On other hand Syntax for fgrep command would be in form of "fgrep "." myfile.txt" |
- Related Articles
- Difference between Egrep and Fgrep
- Exclude directories while using grep command?
- What is the difference between Grep and Filter in jQuery?
- What is the difference between ls() command and objects() command in R?
- Difference Between ALTER and UPDATE Command in SQL
- Difference between Free Market Economy and Command Economy
- Difference between Chain of Command and Span of Control
- Difference between Unity of Command and Unity of Direction
- What is the difference between MySQL TRUNCATE and DELETE command?
- Difference between Write-Output and Write-Host command in PowerShell?
- What is the significant difference between MySQL TRUNCATE and DROP command?
- How to use the grep command to search for a string that has a dot in it?
- What is the difference between the New-AZTag and Update-AZTag command in Azure PowerShell?
- How to preserve colouring after piping grep to grep in Linux?
- Difference Between & and &&

Advertisements