I want to exclude some files in find command and it is not working very good! Here is what I did:
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
In this example I used only one file /etc/alternatives/awk
and I don't know how to tell the script to act in my variable exclude
.
Update:
Should I only use this structure?
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