line numbers

How to tell grep to ignore special characters in a string (solution)

Back in the old days I thought that any pattern that was including in single-quotes with the Unix grep command meant that the pattern inside the string was completely ignored by grep. But these days I have to escape special characters with a backslash character, which is really annoying. This example shows what I mean:

How to show line numbers in the vi/vim editor

vim FAQ: How do I show line numbers in the vi/vim editor?

I’m frequently asked if there’s a way to show line numbers in vi (or vim). That is, can you take a normal vim display like this:

aaa
bbb
ccc

and then get vim to show line numbers before each line in the editor, like this:

1 aaa
2 bbb
3 ccc

The answer is a resounding yes.

How to show vim line numbers (vim set number)

You show vim line numbers by issuing this vim “set number” command:

Linux cat command tutorial (and examples)

Linux FAQ: Can you share some examples of the Unix/Linux cat command?

The cat command lets you view text files. If you're familiar with MS-DOS, the cat command is similar to the DOS type command.

However, the cat command gets its name from the word concatenate, and as that name implies, it lets you merge several files together, as you'll see in the examples below.

Intellij - Displaying line numbers

When I first fired up IntelliJ and started using it to edit a Java file, one of the first things I wanted to do was to be able to see line numbers within the file.

Configuring IntelliJ to show line numbers is a no-brainer. Here's how to do it:

  • Select Tools | IDE Options
  • Select Editor
  • In the Display group, click Show line numbers
  • When you're finished here, click OK

That's it. Do this and you're ready to go.