• Home
  • WordPress
  • web Hosting
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • page Speed
  • Deals
  • Services
  • About

RAaz Kumar .com

wordpress tutorials seo hosting etc

Top 10 GREP Commands in linux to search files

Grep command in linux explained

Grep command used for search files and search pattern.
grep [options] pattern [files]

Options Description

-c : counts the frequency only
-h : Display the matched lines, but do not display the filenames.
-i : case insensitive Ignores, case for matching
-l : filenames only.(imp)
-n :  line number if word in a file
-v : lines that are not matched with the keyword
-e exp : Specifies expression with this option. Can use multiple times.
-f file : takes the file patterns
-E : Treats pattern as an extended regular expression (ERE)
-w : prints whole words in a file
-o : Print only matched words per line

Expressions

Start ^
End $
grep “^linux” mynewfile.txt
grep “ux$” mynewfile.txt
$grep –e “admin” –e “admin” –e “admin” newfile.txt
$grep –f newfile.txt  mynewfile.txt

grep ‘word’ file1 file2 file3

grep -n ‘root’ /etc/passwd
grep –color root /etc/passwd
Finding a text in list of files in a directory.

Grep From Files and Display the File Name On Linux

grep -l “string” filenamegrep -l root /etc/*

Searching a String / word in files & directories

root@instance-1:/etc/nginx# grep -nr ‘cache-control’ .
./conf.d/global.config:62:add_header cache-control “max-age=31536000”;
./conf.d/expires.global:5:add_header cache-control: max-age=31536000;

 

 use grep recursively

grep -R “192.168.0.1” /etc/
grep -R ‘string’ dir/
grep -R ‘expires’ /etc/nginx/
root@instance-1:/etc/nginx# grep -R ‘expires’ /etc/nginx/
/etc/nginx/rocket-nginx/default.conf: expires 30d;
/etc/nginx/rocket-nginx/default.conf: expires 30d;
/etc/nginx/rocket-nginx/default.conf: expires 30d;
/etc/nginx/rocket-nginx/rocket-nginx.tmpl: expires 30d;
/etc/nginx/rocket-nginx/rocket-nginx.tmpl: expires 30d;
/etc/nginx/rocket-nginx/rocket-nginx.tmpl: expires 30d;
/etc/nginx/sites-enabled/rajuginne: # Directives to send expires headers and turn off 404 error logging.
/etc/nginx/sites-enabled/rajuginne: expires 24h;
/etc/nginx/conf.d/default.conf: expires 31536000s;
/etc/nginx/conf.d/default.conf: expires 3600s;
/etc/nginx/conf.d/default.conf: expires 31536000s;
/etc/nginx/conf.d/headers.conf:#add_header expires $expires;
/etc/nginx/conf.d/headers.conf:map $sent_http_content_type $expires {
/etc/nginx/conf.d/browsercaching.confg: expires 3600s;
/etc/nginx/conf.d/expires.global: expires 365d;
/etc/nginx/conf.d/global2.config: expires max;
grep -R ‘add_header’ /etc/nginx/
grep -nr ‘ssl’ .
t@instance-1:/etc/nginx# grep -nr ‘ssl’ .
./nginx.conf:38: #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
./nginx.conf:39: #ssl_prefer_server_ciphers on;
./rocket-nginx/README.md:153:**<a name=’faq_ssl’>Will Rocket-Nginx work if my we bsite uses a SSL certificate (https) ?</a>**
./sites-enabled/f.in.conf:5:#ssl on;
./sites-enabled/ff.in.conf:6:ssl_certificate /etc/nginx/ssl/ssc.pem;
./sites-enabled/ff.in.conf:7:ssl_certificate_key /etc/nginx/ssl/ssc.key;
./sites-enabled/ffff.in:5:#listen 443 ssl http2;
./sites-enabled/.in:8:#include /etc/letsencrypt/options-ssl-nginx. conf;
The dot at the end searches the current directory. Meaning for each parameter:
-n Show relative line number in the file
‘yourString*’ String for search, followed by a wildcard character
-r Recursively search subdirectories listed
. Directory for search (current directory)
cd /etc/nginx/sites-enabled#
grep -nr ‘ssl’ .
./eaadharcard.co.in.conf:8: ssl on;
./eaadharcard.co.in.conf:9: ssl_certificate /etc/nginx/ssl/eaadharcard.co.in.pem;
./eaadharcard.co.in.conf:10: ssl_certificate_key /etc/nginx/ssl/eaadharcard.co.in.key;
./employmentnewsdaily.in:5: ssl on;

root@instance-1:~# grep . /proc/sys/net/ipv4/tcp*mem

/proc/sys/net/ipv4/tcp_mem:45525        60702   91050
/proc/sys/net/ipv4/tcp_rmem:4096        131072  6291456
/proc/sys/net/ipv4/tcp_wmem:4096        16384   4194304
root@instance-1:~#/etc/nginx/sites-enabled# grep -nr ‘raazkumar.com‘ .

Related topics:

  1. linux commands pdf (files & Directories, zip & unzip process, search etc)
  2. TOP 10 mv & cp commands in linux to move & copy files in Linux
  3. Top 10 zip / tar commands to compress & extract files in linux
  4. Top 10 most used Cat commands with examples (create, view, append files)
  5. lsof netstat commands to know listening ports in linux 3 ways

 

PUBG Mobile Tips & Tricks

free fire how to play (a-z guide) guns, tips &#038; tricks etc

Windows 10 tips & tricks

Pagespeed optimization

Pc building tips & tricks

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

Android studio tutorials

Gaming/ streaming tips

Airtel dth channel list

 

tutorials

  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Devops course Syllabus topics PDF AWS, Azure, cisco, redhat
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
  • Vivek Bindra Videos Transcription (business strategy)
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
    • top 10 apt & apt-get commands (most used) apt vs apt-get
    • linux commands pdf (files & Directories, zip & unzip process, search etc)
    • linux performance tuning inode limit file descriptors tco, kernel etc
    • Top 10 most used Cat commands with examples (create, view, append files)
    • Ip tables / ufw / firewall d commands for block port ip rate limiting
    • Top 10 zip / tar commands to compress & extract files in linux
    • TOP 10 mv & cp commands in linux to move & copy files in Linux
    • Top 10 GREP Commands in linux to search files
    • lsof netstat commands to know listening ports in linux 3 ways
    • Upgrade Ubuntu from 18.04 (19.10) to 20.04 LTS command line or gui server | desktop
    • 3 Ways (SCP, rsync, Sftp) linux server migration between two remote server apache nginx
    • linux system specs commands (CPU, Memory, Disk )speed, type. manufacture
    • linux sysctl command tweaks & hardening
    • linux security limits.conf deciding user limits process limits for nginx server
    • ulimit linux unlimited command unlimto set & know user limits open files file descriptor max user process etc.
    • red hat certification syllabus
  • apache server tutorial (install,config, performance tuning, security, error handling)

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2021 - All Rights Reserved Disclaimer & Privacy Policy