() You can use parentheses to group parts of the regular expression, just as you do in a mathematical expression.

|| means “or.” You can use it to provide a series of alternative expressions. Usually you want to put the alternatives in parentheses, like this: c(ad|ab|at)matches cad or cab or cat. Without the parentheses, it would match cad or ab or at instead

Debian GNU/Linux : Guide to Installation and Usage — Part 80

\ Escapes any special characters; if you want to find a literal *, you type \*. The slash means to ignore *’s usual special meaning.

Debian GNU/Linux : Guide to Installation and Usage — Part 80

Here are some more examples to help you get a feel for things:

Debian GNU/Linux : Guide to Installation and Usage — Part 80

xyz.* matches xyz and anything after it; some tools, like egrep, only match until the end of the line.

^The matches The at the beginning of a line.

atime$ matches atime at the end of a line.

^Only$ matches a line that consists solely of the word Only—no spaces, no other characters, nothing. Only Only is allowed.

Ver[^0-9] matches Ver followed by any non-digit.

the[ir][re] matches their, therr, there, theie.

[A-Za-z][A-Za-z]* matches any word which consists of only letters, and at least one letter. It will not match numbers or spaces.

Now that you have a basic understanding of files, it is time to learn more advanced things about them.

13.2.1 The Real Nature of Files: Hard Links and Inodes

Each file on your system is represented by an _inode_ (for Information Node; pronounced “eye-node”). An inode contains all the information about the file. However, the inode is not directly visible. Instead, each inode is linked into the filesystem by one or more _hard links_. Hard links contain the name of the file and the inode number. The inode contains the file itself, i.e., the location of the information being stored on disk, its access permissions, the file type, and so on. The system can find any inode if it has the inode number.

A single file can have more than one hard link. What this means is that multiple filenames refer to the same file (that is, they are associated with the same inode number). However, you can’t make hard links across filesystems: All hard references to a particular file (inode) must be on the same filesystem. This is because each filesystem has its own set of inodes, and there can be duplicate inode numbers on different filesystems.