sfactor
sfactor

Reputation: 13062

creating symbolic link from select file type in a folder

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.

Upvotes: 3

Views: 2581

Answers (1)

Giuseppe Cardone
Giuseppe Cardone

Reputation: 5393

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.

Upvotes: 2

Related Questions