Creating a symbolic link from the selected file type in the folder

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

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

Warning. To do work with one liner, you must use absolute paths.

+2
source

Source: https://habr.com/ru/post/1766914/


All Articles