Sunday, August 14, 2011

Search for File containing specific text.


Something
Search for a string called redeem reward in all text files located in /home/tom/*.txt directory, use

$ grep "redeem reward" /home/tom/*.txt

Task: Search all subdirectories recursively

You can search for a text string all files under each directory, recursively with -roption:

$ grep -r "redeem reward" /home/tom

Task: Only print filenames

By default, grep command prints the matching lines You can pass -H option to print the filename for each match.

$ grep -H -r “redeem reward” /home/tom

Output:

filename.txt: redeem reward

...To just print the filename use cut command as follows:

$ grep -H vivek /etc/* -R
cut -d: -f1

Output:
filename.txt

Friday, August 12, 2011

System Administrator - while joining new project. Taking hand over of Servers.

Get access credentials.

Figure out current owners of servers. Your scope in handling those servers.


Details of service running on each physical server. ( check by ps -eaf command). Get details of service running. There configuration files. Purpose.

architecture of application if running on multiple servers. Where is Database. Middle ware, Where is application running, Storage for that application.

Details of configuration files in use.

Network configuration ( IP address - iptables if running), check routes. Check all interface connected. VLAN information.

Details of backup. How they are being taken, Backup Schedule. Backup tool in use.


VERY IMPORTANT -- Try to deploy application or tool with same configuration on test environment to get total control, else iyou will always be lost.