Debian GNU/Linux : Guide to Installation and Usage by John Goerzen;Ossama Othman
page 104 of 298 (34%)
page 104 of 298 (34%)
![]() | ![]() |
|
Clearly a pipeline is more convenient. Filename Expansion Often you want a command to work with a group of files. Wildcards are used to create a filename expansion pattern: a series of characters and wildcards that expands to a list of filenames. For example, the pattern /etc/* expands to a list of all6.2 the files in /etc. * is a wildcard that can stand for any series of characters, so the pattern /etc/* will expand to a list of all the filenames beginning with /etc/. This filename list is most useful as a set of arguments for a command. For example, the /etc directory contains a series of subdirectories called rc0.d, rc1.d, etc. Normally to view the contents of these, you would type the following: ls /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d ls /etc/rc4.d /etc/rc5.d /etc/rc6.d /etc/rcS.d This is tedious. Instead, you can use the ? wildcard as shown here: ls /etc/rc?.d /etc/rc?.d expands to a list of filenames that begin with rc, followed by any single character, followed by .d. Available wildcards include the following: |
|