InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search
  • Home
  • > Tutorials
  • > grep

How to do grep without regex (fixed string)

on Feb 2, 2016

Linux (or Unix) grep without any options does a regex grep on input stream. To disable regex either one can use grep -F or fgrep. Here are some examples.

Default grep example

printf "foophp\nfoo.php\n" | grep ".php"
foophp
foo.php
Env: GNU bash, version 4.2.46

grep without regex example

printf "foophp\nfoo.php\n" | grep -F ".php"
foo.php
Env: GNU bash, version 4.2.46

fgrep example

printf "foophp\nfoo.php\n" | fgrep ".php"
foo.php
Env: GNU bash, version 4.2.46

Suggested posts:

  1. How to install Imagemagick on Ubuntu Linux
  2. migrate multiple mysql databases using mysqldump on Linux
  3. AngularJS format date using date filter
  4. wget handy commands
  5. Bash – local and global variables
  6. display method names from php WP_Query object
  7. How to include wordpress pages in archives
  8. CSS visibility – hide an element keeping its space
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged grep, Linux/Unix Command Line, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress