Skip to main content

Find string in file - linux

code:

#!/bin/bash
if [ "$1" != "" ]; then echo 'path to search: ' $1 echo 'Search for: ' $2 grep -H -r --color -E "$2" $1 else echo "sfind <path> <word> " fi


 


Save to file in /usr/bin/>filenam>
chmod a+x <filename>

I use sfind for filename

Comments

Popular posts from this blog

WSUS stuff....

Did GPO settings propagate to client? REG QUERY "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate"   Quick checking: make a bat file with: wuauclt /detectnow wuauclt /reportnow To test conectivety go to: https://<server url>:8531/selfupdate/wuident.cab should download a file Check reg for settings: REG QUERY "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate"  

Upgrading Cisco Prime (3.0.to 3.1)

This is a short step by step process to upgrade Cisco Prime It's important to do this from local console and not ssh as this is a OS upgrade Download upgrade image from cisco.com https://software.cisco.com/download/release.html?mdfid=286304360&catid=278875243&softwareid=284272932&release=3.1.0&relind=AVAILABLE&rellifecycle=&reltype=latest  Backup open Prime console (vm console) Check that file is in repo conf t repo FTP url ftp://ip user <usernanme>  password plain <pass> sh repo File should be in repo copy ftp://<ip>/PI-Upgrade-3.0.X_to_3.1.0.0.132.tar.gz disk:/defaultRepo ncs stop application upgrade <filename> refaultRepo (coud also bee remote if file not copied) Done!

WIFI probe

http://www.nirsoft.net/utils/wireless_network_view.html Shows all wifi and accesspoints... http://www.nirsoft.net/utils/wireless_key.html Shows lokal wifi passwords