WARNING: This site is intended for online use only; mass-downloading of pages degrades the server and is prohibited.
If you attempt to use tools to mass-download the site, you may be blocked permanently by automated software.
If you want to read this CertiGuide offline, please use one of the links on the left to purchase a convenient PDF copy. Thank you.

Get the A+ 4 Real e-book for your own computer.
Click Here!

Custom Search






Table Of Contents  CertiGuide to A+ (A+ 4 Real)
 9  Chapter 5: The Linux Operating System
      9  Basic Concepts and Procedures for Creating, Viewing and Editing Files and Directories

Previous Topic/Section
Match Negation
Previous Page
Pages in Current Topic/Section
1
Next Page
Pipes And Redirection
Next Topic/Section

Examples of Using Meta Characters

Meta character can be very useful when copying several files. Using that same file list to copy the files hat22 hat23 hat31 hat32 hat33 from the current directory to the directory /home/example, the command would be:

cp hat[23]? /home/example

In other words, this command will copy all files in the current directory that start with hat followed by the digits 2 or 3 with at least one additional character or number to the /home/example directory. The ? is required in this example to eliminate copying the file hat2 since it would meet all of the criteria up to the final ?.

Meta characters can be used in any command argument that uses a file name. A command that would yield interesting results using the above example of file names is:

more hat1?

This would cause more to open initially the file hat11. When that was finished or quit, immediately the file hat12 would be sent to the screen, and then followed by the file hat13.

Meta character’s can be used to shorten the list of files displayed when using the ls command. Again using the same list of filenames, the command:

ls -l hat[12][^3]

would show the long form of the directory listing for only the files that start with the characters hat followed by a either the digits 1 or 2 and not followed by a 3. The result would then be a long listing for the files hat11 hat12 hat21 hat22 .


Previous Topic/Section
Match Negation
Previous Page
Pages in Current Topic/Section
1
Next Page
Pipes And Redirection
Next Topic/Section

If you find CertiGuide.com useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider buying an inexpensive PDF equivalent of the CertiGuide to A+ (A+ 4 Real) from StudyExam4Less.com. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $



Home - Table Of Contents - Contact Us

CertiGuide to A+ (A+ 4 Real) (http://www.CertiGuide.com/apfr/) on CertiGuide.com
Version 1.0 - Version Date: March 29, 2005

Adapted with permission from a work created by Tcat Houser et al.
CertiGuide.com Version Copyright 2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.