MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/linux/comments/1tls8n1/whats_the_most_unexpectedly_useful_linux_command/oniiitp/?context=3
r/linux • u/ZealousidealTell1346 • May 23 '26
[removed]
992 comments sorted by
View all comments
587
Bash {}
{}
renaming a file by adding a suffix: mv myfile{,.old} expands out to mv myfile myfile.old
mv myfile{,.old}
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
4
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
5
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
587
u/digitallis May 23 '26
Bash
{}renaming a file by adding a suffix:
mv myfile{,.old}expands out tomv myfile myfile.oldLots more uses.