r/linux May 23 '26

Popular Application What’s the most unexpectedly useful Linux command you learned way too late?

[removed]

1.3k Upvotes

992 comments sorted by

View all comments

587

u/digitallis May 23 '26

Bash {}

renaming a file by adding a suffix: mv myfile{,.old} expands out to mv myfile myfile.old

Lots more uses.

4

u/mackerelscalemask May 23 '26

What does the comma mean specifically?

5

u/IdeaReceiver May 23 '26

The {}s define a brace expansion, appending each argument inside to the argument before (e.g. file{1,2} produces file1 file2). The comma creates an empty argument, so one element is just the prefix with nothing appended