小编the*_*tar的帖子

链接多个文件

在 中bash,假设我想链接目录中的一些但不是所有文件,例如,

ln -s /dir/file1 /dir/file2 ... /other/dir
Run Code Online (Sandbox Code Playgroud)

但是文件名的格式不遵循一些简单的规则,所以我们不能使用类似

ln -s /dir/file* /target/dir.
Run Code Online (Sandbox Code Playgroud)

无论如何不要重复/dir,例如:

/dir/{file1 file2 ...} = /dir/file1 /dir/file2 ...
Run Code Online (Sandbox Code Playgroud)

所以我们可以做这样的事情:

ln -s /dir/{file1 file2 ...} /target/dir
Run Code Online (Sandbox Code Playgroud)

linux bash shell command-line

2
推荐指数
1
解决办法
247
查看次数

标签 统计

bash ×1

command-line ×1

linux ×1

shell ×1