O'Reilly logo

SAMS Teach Yourself Unix in 10 Minutes by Robert Shimonski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Aliases

To use aliases, you must first understand what an alias is. An alias is a file that represents another object in the file system. For example, if you specify a file that just says grepnow, inside it you may have a complex grep command with REs (regular expressions) and/or many options. Typing grepnow at the shell prompt will execute that file's contents, which will be the longer command. What would you rather type out?

grepnow
grep "[:digit:]\{3\}[ -]\?[:digit:]\{4\}" file

The choice is clear. Using aliases can really save you time on frequently entered commands, especially if they are long in syntax.

Suppose you want to match a specific number of repetitions of a pattern. A good example is a phone number. You could easily search for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required