By Keith Mitnick on Sunday, 06 March 2016
Category: General

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

Leave Comments