【发布时间】:2021-02-16 03:53:35
【问题描述】:
我想在 find 命令中排除一些文件,但效果不是很好!这是我所做的:
arg=$1
exclude="/etc/alternatives/awk
/usr/sbin/poweroff
/usr/bin/ls"
find $arg -type f,l,c,b -path /etc/alternatives/awk -prune -o -print
在这个示例中,我只使用了一个文件 /etc/alternatives/awk,但我不知道如何告诉脚本在我的变量 exclude 中执行操作。
更新:
我应该只使用这种结构吗?
find $arg -type f,l,c,b -path /usr/bin/pwd -prune -o -path /etc/alternatives/awk -prune -o -path /usr/sbin/poweroff -prune -o -path /usr/bin/ls -prune -o -print
【问题讨论】:
-
可以this thread帮忙吗?
标签: bash for-loop awk sed find