Technical professionals. Trusted advisors. Certified expertise.

  • Home
  • Support
  • Blog
  • Use brace expansion to copy a file without having to type in the file name twice.

HCS Blog

Problem-solving by Apple Certified Professionals

Use brace expansion to copy a file without having to type in the file name twice.

In this example, the file named “file1.txt” with be copied to a file named “file1.txt.bak” without having to type in the second file name.  This is done using brace expansion.

 In Terminal, enter the command below:

cp file1.txt{,.bak}


You should now have two files:

file1.txt

file1.txt.bak

×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

Add Color to the ls command in Mac OS X
Generate ASCII Art in OS X

Locations


New York

Connecticut
Florida
Louisiana
Chicago

Corporate Headquarters
New York

80 Orville Drive Suite 100
Bohemia, NY 11716
Tel: (866) 518-9672
This email address is being protected from spambots. You need JavaScript enabled to view it.

Connecticut

65 High Ridge Road #510
Stamford, CT 06905
Tel: (866) 518-9672
This email address is being protected from spambots. You need JavaScript enabled to view it.

Florida

3321 SW 194th Terrace
Miramar, FL 33029
Tel: (866) 518-9672
This email address is being protected from spambots. You need JavaScript enabled to view it.

Louisiana

218 Barksdale Drive
Broussard LA 70518
This email address is being protected from spambots. You need JavaScript enabled to view it.

Chicago

4 Knollwood Place
Joliet, IL 60433
This email address is being protected from spambots. You need JavaScript enabled to view it.

London

10 Grosvenor Court
Rayners Road
London SW15 2AX UK

Stay Connected

© Copyright 2023, HCS Technology Group. All Rights Reserved.