1.如,在终端中输入下面命令:
echo foo{1,2,3}.txt
输出如下:
foo1.txt foo2.txt foo3.txt
2.也可以使用下面附加的实例,去在命令中“创建”一个参数,以节省输入的时间,提高工作效率:
echo file.txt{,.bak}
输出如下:file.txt file.txt.bak
echo file-{a..d}.txt
输出如下: file-a.txt file-b.txt file-c.txt file-d.txt
echo mkdir -p /apache-jail/{user,bin,lib64,dev}
输出如下: mkdir -p /apache-jail/user /apache-jail/bin /apache-jail/lib64 /apache-jail/dev
echo cp httpd.conf{,.backup}
输出如下:cp httpd.conf httpd.conf.backup
echo mv delta.{txt,doc}
输出如下:mv delta.txt delta.doc
cp /etc/apt/sources.{list, list.bak}
输出如下:cp /etc/apt/sources.list /etc/apt/sources.list.bak