Igor Simic
4 years ago

Usefull terminal commands



This is collection of useful terminal commands which can be used for many different things


1. Search for term inside of files in a folder and return file which contains that term
grep -r 'search term' *

2. Search inside of gzip file
zgrep "search_term" file_name.txt.gz  

grep "search_term" file_name_*.txt




3. How to add private key using terminal needed for login on remote server:
man ssh
ssh -i /path_to_private_key/privatekey.pem [email protected]

4. restart apache
service httpd restart

5. Mod PageSpeed

  • CLEAR CACHE
  • go to cache folder:
       cd /var/mod_pagespeed/cache/
    clear cache
       touch cache.flush
  • EDIT CONF
  • nano /etc/apache2/conf.modules.d/456_pagespeed.conf
  • EXCLUDE URL FROM CACHE
  • ModPagespeedDisallow "*/vendor.js"