
根據這一頁看起來排除文件的語法應該是
R /home/webserver/
- .dat1/
- .dat2
- .dat3*
- .dat4/Images\ System/*
- .compile/*/*/Cache
但所有這些目錄仍然包括在內。
問題
我究竟做錯了什麼?
答案1
你看錯例子了。您建立的文件是 for --patterns-from
,而文件 for--exclude-from
只是一個列表,如下所示:
*/.DS_Store
*/._*
*/node_modules
手冊頁中的範例如下:
$ cat >exclude.txt <<EOF
# Comment line
/home/*/junk
*.tmp
fm:aa:something/*
re:^/home/[^/]\.tmp/
sh:/home/*/.thumbnails
EOF
它隱藏在一長串的 shell 指令中。此範例包括其他符合類型。