从文件夹中选择的文件类型创建符号链接

发布于 2024-09-25 08:28:29 字数 132 浏览 2 评论 0原文

我有一个包含许多不同类型文件的文件夹...但在这种情况下我想仅创建特定文件类型的文件(扩展名为 *.txt.mrg 的数据文件)的符号链接...i想要符号链接的文件名与原始文件相同...我该怎么做?我希望能够在一个命令中为该文件类型创建所有符号链接。

i have a folder with many different types of files...but i want to create a symbolic link of only files that are of a certain file type (the data files with extension *.txt.mrg) in this case...i want to have the same file names for the symbolic links as the original files...how do i do this? i want to be able to create all the symbolic links in one command for that file type.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悲念泪 2024-10-02 08:28:29
find /your/source/dir/ -iname '*.txt.mrg' -exec ln -s '{}' /your/dest/dir/ \;

警告:要使这一行有效,您必须使用绝对路径。

find /your/source/dir/ -iname '*.txt.mrg' -exec ln -s '{}' /your/dest/dir/ \;

Warning: to make this one-liner work, you must use absolute paths.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文