Fi 1e13doctxtfi leidoc file3txt

Given this list of files, Table 2-1 shows how you can use wildcards, ranges of values, and lists to match specific files. As you'll see later in this chapter, pattern matching is especially useful when listing filenames and directory names that match specific patterns.

j r - - r As explained later in this chapter, in the section ''Listing Files,'' Unix and Linux sys' - ~ ■"■> ■ tems do not list files that begin with a period by default. (The ls command without options will not show files with names such as .bashrc. As a result, these are known as hidden files.) Therefore, the wildcard * will match only all visible files in a directory (files whose names do not begin with a period), even though the * matches the period in the middle of a filename.

Connecting Commands and Redirecting Input and Output

Unix and Linux commands are designed with a KISS (Keep It Simple, Stupid) philosophy. Some operating systems feature thousands of specialized commands that perform many specific, but similar, tasks. Unix and Linux take the opposite approach, providing many small, simple commands that you can combine to perform complex tasks.

For example, some operating systems might provide a specialized command to print a listing of the current directory. On a Linux system, you would perform this task by combining the existing list (ls) and print (Ipr) commands into a single sequence of commands in which the output of the ls command was provided as input to the Ipr command by connecting the two commands using a special symbol known as a pipe (|), as in the following example:

Was this article helpful?

0 0

Post a comment