Examples of using cp with special characters

Examples of using cp with special characters

To copy files that match on several characters:

   cp *.txt chapt1

This copies all the files in the current working directory with the extension ".txt" to the sub-directory chapt1.


To copy files that match on a single character:

   cp sect?b partA

This copies any file with the name sect[1-9]b to the sub-directory partA.


To copy all the files within a specified range:

   cp sect[1-4]c partB

This copies files sect1c, 2c, 3c and sect4c to the sub-directory partB.


[Home] [Search] [Index] This site maintained by unixhelp@math.rutgers.edu
This page was last updated on September 05, 2006 at 10:29 am and is maintained by webmaster@math.rutgers.edu.
For questions regarding courses and/or special permission, please contact mclausen@math.rutgers.edu.
For questions or comments about this site, please contact help@math.rutgers.edu.
© 2012 Rutgers, The State University of New Jersey. All rights reserved.