How can I stack wildcards to target specific files?

Krotanix

I want to target all files called fooxxxbarxxx. The common thing among all those files is that it contains foo and bar.

I've tried to use *foo*bar* and *foo**bar* but it doesn't work.

Specifically, I'm trying to create soft links to those files, and the rest of the code already works for more straightforward executions (looks into all subfolders of path):

shopt -s globstar

ln -s /path/**/*foo*bar* .

Thanks

Inian

In bash shell you need to use extglob option for this OR type shell expansions.

shopt -s extglob nullglob

and then do the globbing as

ln -s /path/**/@(*foo*bar*|*bar*foo*)

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How can I prevent automerge on specific files

분류에서Dev

How can I symlink to files in a specific Git ref/branch?

분류에서Dev

How can i get the hasClass of click target?

분류에서Dev

How can I throttle stack of api requests?

분류에서Dev

How can I move specific files from within a folder when that folder is added to a directory?

분류에서Dev

How can I view diffs or at least older versions of specific files with etckeeper?

분류에서Dev

how can I move files with specific names from one folder to another

분류에서Dev

How do I target a specific element nested in HTML/CSS code?

분류에서Dev

How do I install and target a specific version of Nitrous.io?

분류에서Dev

How can i target an individual item in a titanium alloy listview?

분류에서Dev

How can I target third child level of parent in jQuery?

분류에서Dev

How can I automatically target the output of a download script

분류에서Dev

How can I set Crontab for a specific hour?

분류에서Dev

How can I connect to a specific BSSID?

분류에서Dev

How can I block a specific host

분류에서Dev

How can I popd to a specific directory?

분류에서Dev

How can I get a specific folder with a specific folders sibling in python

분류에서Dev

How can I "diff" two files with Nautilus?

분류에서Dev

How can I delete files in terminal fluently?

분류에서Dev

how can I fill several files with data?

분류에서Dev

How can I diff two XML files?

분류에서Dev

How can I delete files in terminal fluently?

분류에서Dev

How can I move files into subdirectories by count?

분류에서Dev

How can I combine two files on Windows?

분류에서Dev

How can I move files into subdirectories by count?

분류에서Dev

Can I stack columns with Susy?

분류에서Dev

How do I add a new user with specific configuration files?

분류에서Dev

How do I get the number of lines for specific files in a large directory?

분류에서Dev

How can I list the packages I removed on a specific day?

Related 관련 기사

  1. 1

    How can I prevent automerge on specific files

  2. 2

    How can I symlink to files in a specific Git ref/branch?

  3. 3

    How can i get the hasClass of click target?

  4. 4

    How can I throttle stack of api requests?

  5. 5

    How can I move specific files from within a folder when that folder is added to a directory?

  6. 6

    How can I view diffs or at least older versions of specific files with etckeeper?

  7. 7

    how can I move files with specific names from one folder to another

  8. 8

    How do I target a specific element nested in HTML/CSS code?

  9. 9

    How do I install and target a specific version of Nitrous.io?

  10. 10

    How can i target an individual item in a titanium alloy listview?

  11. 11

    How can I target third child level of parent in jQuery?

  12. 12

    How can I automatically target the output of a download script

  13. 13

    How can I set Crontab for a specific hour?

  14. 14

    How can I connect to a specific BSSID?

  15. 15

    How can I block a specific host

  16. 16

    How can I popd to a specific directory?

  17. 17

    How can I get a specific folder with a specific folders sibling in python

  18. 18

    How can I "diff" two files with Nautilus?

  19. 19

    How can I delete files in terminal fluently?

  20. 20

    how can I fill several files with data?

  21. 21

    How can I diff two XML files?

  22. 22

    How can I delete files in terminal fluently?

  23. 23

    How can I move files into subdirectories by count?

  24. 24

    How can I combine two files on Windows?

  25. 25

    How can I move files into subdirectories by count?

  26. 26

    Can I stack columns with Susy?

  27. 27

    How do I add a new user with specific configuration files?

  28. 28

    How do I get the number of lines for specific files in a large directory?

  29. 29

    How can I list the packages I removed on a specific day?

뜨겁다태그

보관