Grep file and include lines around search result

grep -A 1 -i "Search-for-something" /var/lib/jbossas/server/halprdjbs01/log/server.log

6.1 Display N lines after match

-A is the option which prints the specified N lines after the match as shown below.

Syntax:
grep -A <N> "string" FILENAME

The following example prints the matched line, along with the 3 lines after it.

$ grep -A 3 -i "example" demo_text

6.2 Display N lines before match

-B is the option which prints the specified N lines before the match.

Syntax:
grep -B <N> "string" FILENAME

When you had option to show the N lines after match, you have the -B option for the opposite.

$ grep -B 2 "single WORD" demo_text

6.3 Display N lines around match

-C is the option which prints the specified N lines before the match. In some occasion you might want the match to be appeared with the lines from both the side. This options shows N lines in both the side(before & after) of match.

$ grep -C 2 "Example" demo_text

How to Log into Multiple Facebook Accounts

Multiple ID Login in Internet Explorer 8:

If you’re using Internet explorer 8 then open a window and login to the website you desire with one ID. Once done, press Alt and go to File> New session. Now a new window will open go to the website again and login with another ID. Pretty easy isn’t it?
Using Two Different browsers:

There are so many internet browsers to choose between. Some of the popular ones include- Internet explorer, Opera, Firefox, Chrome, Safari, etc. You can login to one Facebook account in one browser and the other Facebook account in another browser. This way you can login to multiple accounts simultaneously.
Multiple ID Login in Google Chrome:

Logging into different IDs is easier in Google Chrome as comes with an incognito mode that allows you to login to two different instances of the same website.

Firstly, login to the website with your primary ID in Google Chrome.

Now click on the tools icon and select New Incognito Window. Alternatively you can press Ctrl + Shift + N to open a new Incognito Window.

Navigate to the same website and you should be able to login with another user ID.
Multiple ID Login in Firefox and Flock:

Go to Nektra site and install the CookiePie Firefox addon. This addon also works on Flock browser. Once installed, restart the browser. Open a new tab and login to your account with the primary ID.

Now press Ctrl+T to open a new tab. Right click on the tab and select Toggle On/Off Cookiepie.

You’ll now see a cookie on the tab. Now, simply go to the same website and log in with another ID in this tab. Voila! Two Ids are logged in simultaneously.

You may also like to check- How to Log into Multiple GTalk Accounts Simultaneously